[kvm-unit-tests GIT PULL 01/13] s390x/Makefile: simplify Secure Execution boot image generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>

Changes:
+ merge Makefile rules for the generation of the Secure Execution boot
  image
+ fix `parmfile` dependency for the `selftest.pv.bin` target
+ rename `genprotimg_pcf` to `GENPROTIMG_PCF` to match the coding style
  in the file
+ always provide a customer communication key - not only for the
  confidential dump case. Makes the code little easier and doesn't hurt.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
Reviewed-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20231121172338.146006-1-mhartmay@xxxxxxxxxxxxx
Signed-off-by: Nico Boehr <nrb@xxxxxxxxxxxxx>
---
 s390x/Makefile | 36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)

diff --git a/s390x/Makefile b/s390x/Makefile
index ddc0969f..8603a523 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -197,33 +197,27 @@ $(comm-key):
 %.bin: %.elf
 	$(OBJCOPY) -O binary  $< $@
 
-# Will only be filled when dump has been enabled
-GENPROTIMG_COMM_KEY =
-# allow PCKMO
-genprotimg_pcf = 0x000000e0
+# 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
+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
 
 ifeq ($(CONFIG_DUMP),yes)
-	# 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
-	GENPROTIMG_HAS_COMM_KEY = $(shell $(GENPROTIMG) --help | grep -q -- --comm-key && echo yes)
-	ifeq ($(GENPROTIMG_HAS_COMM_KEY),yes)
-		GENPROTIMG_COMM_KEY = --comm-key $(comm-key)
-	else
-		GENPROTIMG_COMM_KEY = --x-comm-key $(comm-key)
-	endif
-
 	# allow dumping + PCKMO
-	genprotimg_pcf = 0x200000e0
+	GENPROTIMG_PCF := 0x200000e0
+else
+	# allow PCKMO
+	GENPROTIMG_PCF := 0x000000e0
 endif
 
-# use x-pcf to be compatible with old genprotimg versions
-genprotimg_args = --host-key-document $(HOST_KEY_DOCUMENT) --no-verify $(GENPROTIMG_COMM_KEY) --x-pcf $(genprotimg_pcf)
-
-%selftest.pv.bin: %selftest.bin $(HOST_KEY_DOCUMENT) $(patsubst %.pv.bin,%.parmfile,$@) $(comm-key)
-	$(GENPROTIMG) $(genprotimg_args) --parmfile $(patsubst %.pv.bin,%.parmfile,$@) --image $< -o $@
-
+$(patsubst %.parmfile,%.pv.bin,$(wildcard s390x/*.parmfile)): %.pv.bin: %.parmfile
 %.pv.bin: %.bin $(HOST_KEY_DOCUMENT) $(comm-key)
-	$(GENPROTIMG) $(genprotimg_args) --image $< -o $@
+	$(eval parmfile_args = $(if $(filter %.parmfile,$^),--parmfile $(filter %.parmfile,$^),))
+	$(GENPROTIMG) --host-key-document $(HOST_KEY_DOCUMENT) --no-verify $(GENPROTIMG_COMM_OPTION) $(comm-key) --x-pcf $(GENPROTIMG_PCF) $(parmfile_args) --image $(filter %.bin,$^) -o $@
 
 $(snippet_asmlib): $$(patsubst %.o,%.S,$$@) $(asm-offsets)
 	$(CC) $(CFLAGS) -c -nostdlib -o $@ $<
-- 
2.44.0





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux