public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages
@ 2024-06-02 13:06 Nicholas Piggin
  2024-06-02 13:06 ` [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary Nicholas Piggin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-06-02 13:06 UTC (permalink / raw)
  To: linux-s390
  Cc: Nicholas Piggin, Janosch Frank, Claudio Imbrenda, Nico Böhr,
	David Hildenbrand, Thomas Huth, kvm

This fixes some non-fatal error messages during build. I have only
tested TCG with no PV, so it's not intended for merge before
that at least.

Thanks,
Nick

Nicholas Piggin (2):
  s390x: Only run genprotimg if necessary
  s390x: Specify program headers with flags to avoid linker warnings

 s390x/Makefile              |  4 ++++
 s390x/snippets/c/flat.lds.S | 12 +++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary
  2024-06-02 13:06 [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Nicholas Piggin
@ 2024-06-02 13:06 ` Nicholas Piggin
  2024-06-03 11:54   ` Janosch Frank
  2024-06-02 13:06 ` [kvm-unit-tests PATCH 2/2] s390x: Specify program headers with flags to avoid linker warnings Nicholas Piggin
  2024-06-04  5:32 ` [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Thomas Huth
  2 siblings, 1 reply; 6+ messages in thread
From: Nicholas Piggin @ 2024-06-02 13:06 UTC (permalink / raw)
  To: linux-s390
  Cc: Nicholas Piggin, Janosch Frank, Claudio Imbrenda, Nico Böhr,
	David Hildenbrand, Thomas Huth, kvm

genprotimg is not required if the --host-key-document= configure option
is not specified, so avoid running it in that case. This prevents the
build message:

  bash: line 1: genprotimg: command not found

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 s390x/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/s390x/Makefile b/s390x/Makefile
index 19c41a2ec..c6518bbd1 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -213,12 +213,16 @@ $(comm-key):
 
 # The genprotimg arguments for the cck changed over time so we need to
 # figure out which argument to use in order to set the cck
+ifneq ($(HOST_KEY_DOCUMENT),)
 GENPROTIMG_HAS_COMM_KEY = $(shell $(GENPROTIMG) --help | grep -q -- --comm-key && echo yes)
 ifeq ($(GENPROTIMG_HAS_COMM_KEY),yes)
 	GENPROTIMG_COMM_OPTION := --comm-key
 else
 	GENPROTIMG_COMM_OPTION := --x-comm-key
 endif
+else
+GENPROTIMG_HAS_COMM_KEY =
+endif
 
 ifeq ($(CONFIG_DUMP),yes)
 	# allow dumping + PCKMO
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [kvm-unit-tests PATCH 2/2] s390x: Specify program headers with flags to avoid linker warnings
  2024-06-02 13:06 [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Nicholas Piggin
  2024-06-02 13:06 ` [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary Nicholas Piggin
@ 2024-06-02 13:06 ` Nicholas Piggin
  2024-06-04  5:32 ` [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Thomas Huth
  2 siblings, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-06-02 13:06 UTC (permalink / raw)
  To: linux-s390
  Cc: Nicholas Piggin, Janosch Frank, Claudio Imbrenda, Nico Böhr,
	David Hildenbrand, Thomas Huth, kvm

Avoid "LOAD segment with RWX permissions" warnings from new linkers
by specifying program headers. See 59a797f451cde and linked commits
for similar fixes for other architectures.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 s390x/snippets/c/flat.lds.S | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/s390x/snippets/c/flat.lds.S b/s390x/snippets/c/flat.lds.S
index 468b5f1ee..6b8ceb9e0 100644
--- a/s390x/snippets/c/flat.lds.S
+++ b/s390x/snippets/c/flat.lds.S
@@ -1,5 +1,11 @@
 #include <asm/asm-offsets.h>
 
+PHDRS
+{
+    text PT_LOAD FLAGS(5);
+    data PT_LOAD FLAGS(6);
+}
+
 SECTIONS
 {
 	.lowcore : {
@@ -29,7 +35,7 @@ SECTIONS
 		*(.init)
 		*(.text)
 		*(.text.*)
-	}
+	} :text
 	. = ALIGN(4K);
 	etext = .;
 	/* End text */
@@ -37,9 +43,9 @@ SECTIONS
 	.data : {
 		*(.data)
 		*(.data.rel*)
-	}
+	} :data
 	. = ALIGN(16);
-	.rodata : { *(.rodata) *(.rodata.*) }
+	.rodata : { *(.rodata) *(.rodata.*) } :data
 	. = ALIGN(16);
 	.bss : { *(.bss) }
 	/* End data */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary
  2024-06-02 13:06 ` [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary Nicholas Piggin
@ 2024-06-03 11:54   ` Janosch Frank
  2024-06-04  5:18     ` Nicholas Piggin
  0 siblings, 1 reply; 6+ messages in thread
From: Janosch Frank @ 2024-06-03 11:54 UTC (permalink / raw)
  To: Nicholas Piggin, linux-s390
  Cc: Claudio Imbrenda, Nico Böhr, David Hildenbrand, Thomas Huth,
	kvm

On 6/2/24 15:06, Nicholas Piggin wrote:
> genprotimg is not required if the --host-key-document= configure option
> is not specified, so avoid running it in that case. This prevents the
> build message:
> 
>    bash: line 1: genprotimg: command not found
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

This solves the immediate problem but I think we're really missing a lot 
more checks in the makefile and configure to sanitize the SE option space.

Anyway:
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary
  2024-06-03 11:54   ` Janosch Frank
@ 2024-06-04  5:18     ` Nicholas Piggin
  0 siblings, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-06-04  5:18 UTC (permalink / raw)
  To: Janosch Frank, linux-s390
  Cc: Claudio Imbrenda, Nico Böhr, David Hildenbrand, Thomas Huth,
	kvm

On Mon Jun 3, 2024 at 9:54 PM AEST, Janosch Frank wrote:
> On 6/2/24 15:06, Nicholas Piggin wrote:
> > genprotimg is not required if the --host-key-document= configure option
> > is not specified, so avoid running it in that case. This prevents the
> > build message:
> > 
> >    bash: line 1: genprotimg: command not found
> > 
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>
> This solves the immediate problem but I think we're really missing a lot 
> more checks in the makefile and configure to sanitize the SE option space.

Agree, it would be ideal to find genprotimg at configure time
and warn or fail if other options were specified. That looked
like a bigger job and I don't have a PV environment to test with
at the moment.

> Anyway:
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

Thanks,
Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages
  2024-06-02 13:06 [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Nicholas Piggin
  2024-06-02 13:06 ` [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary Nicholas Piggin
  2024-06-02 13:06 ` [kvm-unit-tests PATCH 2/2] s390x: Specify program headers with flags to avoid linker warnings Nicholas Piggin
@ 2024-06-04  5:32 ` Thomas Huth
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2024-06-04  5:32 UTC (permalink / raw)
  To: Nicholas Piggin, linux-s390
  Cc: Janosch Frank, Claudio Imbrenda, Nico Böhr,
	David Hildenbrand, kvm

On 02/06/2024 15.06, Nicholas Piggin wrote:
> This fixes some non-fatal error messages during build. I have only
> tested TCG with no PV, so it's not intended for merge before
> that at least.
> 
> Thanks,
> Nick
> 
> Nicholas Piggin (2):
>    s390x: Only run genprotimg if necessary
>    s390x: Specify program headers with flags to avoid linker warnings

Thanks, I reviewed and tested the patches, and all looks fine. Thus I went 
ahead and merged the two patches now.

  Thomas



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-04  5:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-02 13:06 [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Nicholas Piggin
2024-06-02 13:06 ` [kvm-unit-tests PATCH 1/2] s390x: Only run genprotimg if necessary Nicholas Piggin
2024-06-03 11:54   ` Janosch Frank
2024-06-04  5:18     ` Nicholas Piggin
2024-06-02 13:06 ` [kvm-unit-tests PATCH 2/2] s390x: Specify program headers with flags to avoid linker warnings Nicholas Piggin
2024-06-04  5:32 ` [kvm-unit-tests PATCH 0/2] s390x: Fix build error messages Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox