* [PATCH v1 0/3] Extend secure IPL support to virtio-blk-pci boot devices
@ 2026-08-12 15:21 Joshua Daley
2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Joshua Daley @ 2026-08-12 15:21 UTC (permalink / raw)
To: qemu-s390x
Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman,
mjrosato, richard.henderson, iii, david, cohuck, jdaley
This series is based on Zhuoying Cai's series,
"[PATCH v17 00/34] Secure IPL Support for SCSI Scheme of virtio-blk/virtio-scsi Devices"
https://lore.kernel.org/qemu-devel/20260730214624.2328883-1-zycai@linux.ibm.com/
Note, the above series is based on Cornelia Huck's patch,
"[PATCH for-11.2] hw: add compat machines for 11.2"
https://lore.kernel.org/qemu-devel/20260723163806.368127-1-cohuck@redhat.com/
which requires a small fix to apply (see Eric Farman's reply).
---
To add support for secure IPL with a virtio-blk-pci boot device, we simply
write secure boot flags to the IPLB when using such a boot device.
This is achieved by calling s390_apply_secure_boot() in the PCI boot
device case of s390_build_iplb().
The secure IPL functional verification test is updated with an additional
subtest for the virtio-blk-pci boot device case. To run the FVT:
make check-functional-s390x MTESTARGS="func-s390x-secure_ipl" \
QEMU_TEST_ALLOW_LARGE_STORAGE=1
To test secure IPL yourself, view the "Secure IPL Quickstart" guide in:
docs/system/s390x/secure-ipl.rst
Joshua Daley (3):
hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder
tests/functional/s390x/test_secure_ipl: Skip test if SIPL not
supported by hypervisor
tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev
case
hw/s390x/ipl.c | 8 +--
tests/functional/s390x/test_secure_ipl.py | 88 +++++++++++++++++------
2 files changed, 68 insertions(+), 28 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder 2026-08-12 15:21 [PATCH v1 0/3] Extend secure IPL support to virtio-blk-pci boot devices Joshua Daley @ 2026-08-12 15:21 ` Joshua Daley 2026-08-17 18:54 ` Jared Rossi ` (2 more replies) 2026-08-12 15:21 ` [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor Joshua Daley 2026-08-12 15:21 ` [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case Joshua Daley 2 siblings, 3 replies; 14+ messages in thread From: Joshua Daley @ 2026-08-12 15:21 UTC (permalink / raw) To: qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck, jdaley In the PCI boot device case of s390_build_iplb(), call s390_apply_secure_boot() to update the IPLB when secure boot or audit mode are enabled. Secure IPL is now supported for virtio-blk-pci boot devices. Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> --- hw/s390x/ipl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index d59ed36c78..b0da3cbb27 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -599,11 +599,6 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) pbdev = s390_get_pci_device(dev_st, &devtype); if (pbdev) { - if (s390_secure_boot_enabled() || s390_has_certificate()) { - error_report("Virtio pci boot device does not support secure boot!"); - exit(1); - } - pci_lp = object_property_get_str(OBJECT(pbdev->pdev), "loadparm", NULL); if (pci_lp && strlen(pci_lp) > 0) { lp = pci_lp; @@ -625,6 +620,9 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) s390_ipl_convert_loadparm((char *)lp, iplb->loadparm); iplb->flags |= DIAG308_FLAGS_LP_VALID; + s390_apply_secure_boot(iplb, devtype, s390_secure_boot_enabled(), + s390_has_certificate()); + return true; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder 2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley @ 2026-08-17 18:54 ` Jared Rossi 2026-08-17 19:34 ` Zhuoying Cai 2026-08-24 13:49 ` Matthew Rosato 2 siblings, 0 replies; 14+ messages in thread From: Jared Rossi @ 2026-08-17 18:54 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, zycai, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck On 8/12/26 11:21 AM, Joshua Daley wrote: > In the PCI boot device case of s390_build_iplb(), call > s390_apply_secure_boot() to update the IPLB when secure boot or audit > mode are enabled. > > Secure IPL is now supported for virtio-blk-pci boot devices. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> > --- > hw/s390x/ipl.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c > index d59ed36c78..b0da3cbb27 100644 > --- a/hw/s390x/ipl.c > +++ b/hw/s390x/ipl.c > @@ -599,11 +599,6 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) > > pbdev = s390_get_pci_device(dev_st, &devtype); > if (pbdev) { > - if (s390_secure_boot_enabled() || s390_has_certificate()) { > - error_report("Virtio pci boot device does not support secure boot!"); > - exit(1); > - } > - > pci_lp = object_property_get_str(OBJECT(pbdev->pdev), "loadparm", NULL); > if (pci_lp && strlen(pci_lp) > 0) { > lp = pci_lp; > @@ -625,6 +620,9 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) > s390_ipl_convert_loadparm((char *)lp, iplb->loadparm); > iplb->flags |= DIAG308_FLAGS_LP_VALID; > > + s390_apply_secure_boot(iplb, devtype, s390_secure_boot_enabled(), > + s390_has_certificate()); > + > return true; > } > Reviewed-by: Jared Rossi <jrossi@linux.ibm.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder 2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley 2026-08-17 18:54 ` Jared Rossi @ 2026-08-17 19:34 ` Zhuoying Cai 2026-08-24 13:49 ` Matthew Rosato 2 siblings, 0 replies; 14+ messages in thread From: Zhuoying Cai @ 2026-08-17 19:34 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, jrossi, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck Reviewed-by: Zhuoying Cai <zycai@linux.ibm.com> On 8/12/26 11:21 AM, Joshua Daley wrote: > In the PCI boot device case of s390_build_iplb(), call > s390_apply_secure_boot() to update the IPLB when secure boot or audit > mode are enabled. > > Secure IPL is now supported for virtio-blk-pci boot devices. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> > --- > hw/s390x/ipl.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c > index d59ed36c78..b0da3cbb27 100644 > --- a/hw/s390x/ipl.c > +++ b/hw/s390x/ipl.c > @@ -599,11 +599,6 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) > > pbdev = s390_get_pci_device(dev_st, &devtype); > if (pbdev) { > - if (s390_secure_boot_enabled() || s390_has_certificate()) { > - error_report("Virtio pci boot device does not support secure boot!"); > - exit(1); > - } > - > pci_lp = object_property_get_str(OBJECT(pbdev->pdev), "loadparm", NULL); > if (pci_lp && strlen(pci_lp) > 0) { > lp = pci_lp; > @@ -625,6 +620,9 @@ static bool s390_build_iplb(DeviceState *dev_st, IplParameterBlock *iplb) > s390_ipl_convert_loadparm((char *)lp, iplb->loadparm); > iplb->flags |= DIAG308_FLAGS_LP_VALID; > > + s390_apply_secure_boot(iplb, devtype, s390_secure_boot_enabled(), > + s390_has_certificate()); > + > return true; > } > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder 2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley 2026-08-17 18:54 ` Jared Rossi 2026-08-17 19:34 ` Zhuoying Cai @ 2026-08-24 13:49 ` Matthew Rosato 2 siblings, 0 replies; 14+ messages in thread From: Matthew Rosato @ 2026-08-24 13:49 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, richard.henderson, iii, david, cohuck On 8/12/26 11:21 AM, Joshua Daley wrote: > In the PCI boot device case of s390_build_iplb(), call > s390_apply_secure_boot() to update the IPLB when secure boot or audit > mode are enabled. > > Secure IPL is now supported for virtio-blk-pci boot devices. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor 2026-08-12 15:21 [PATCH v1 0/3] Extend secure IPL support to virtio-blk-pci boot devices Joshua Daley 2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley @ 2026-08-12 15:21 ` Joshua Daley 2026-08-17 20:01 ` Jared Rossi ` (2 more replies) 2026-08-12 15:21 ` [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case Joshua Daley 2 siblings, 3 replies; 14+ messages in thread From: Joshua Daley @ 2026-08-12 15:21 UTC (permalink / raw) To: qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck, jdaley Currently, if secure IPL is not supported by the hypervisor, the test will fail because "Verified component" never appears. One must inspect the console log to observe the cause of the failure. Add a check that skips the test if the host CPU model is missing the secure IPL facilities. Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> --- tests/functional/s390x/test_secure_ipl.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/s390x/test_secure_ipl.py b/tests/functional/s390x/test_secure_ipl.py index 06fc93e404..5af36b91d8 100755 --- a/tests/functional/s390x/test_secure_ipl.py +++ b/tests/functional/s390x/test_secure_ipl.py @@ -29,6 +29,22 @@ def __init__(self, *args, **kwargs): self.cert_path = None self.prompt = None + def _require_host_secure_ipl_support(self, vm): + """ + Skip the test if the host CPU model does not expose the Secure IPL + facilities (sipl, sclaf, cstore). + """ + props = vm.cmd('query-cpu-model-expansion', + model={'name': 'host'}, + type='full')['model']['props'] + missing = [f for f in ('sipl', 'sclaf', 'cstore') + if not props.get(f)] + if missing: + self.skipTest( + f"Host CPU does not support Secure IPL: " + f"missing feature(s): {', '.join(missing)}. " + f"Secure IPL requires a z16+ host.") + def _create_certificate(self, vm): """Generate x509 certificate""" exec_command_and_wait_for_pattern(self, @@ -107,6 +123,8 @@ def setup_s390x_secure_ipl(self): '-device', 'virtio-blk-ccw,drive=drive0,bootindex=1') temp_vm.launch() + self._require_host_secure_ipl_support(temp_vm) + # Initial root account setup (Fedora first boot screen) self.root_password = 'fedora40password' wait_for_console_pattern(self, 'Please make a selection from the above', -- 2.34.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor 2026-08-12 15:21 ` [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor Joshua Daley @ 2026-08-17 20:01 ` Jared Rossi 2026-08-24 13:50 ` Matthew Rosato 2026-08-24 16:40 ` Zhuoying Cai 2 siblings, 0 replies; 14+ messages in thread From: Jared Rossi @ 2026-08-17 20:01 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, zycai, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck On 8/12/26 11:21 AM, Joshua Daley wrote: > Currently, if secure IPL is not supported by the hypervisor, the test > will fail because "Verified component" never appears. One must inspect > the console log to observe the cause of the failure. > > Add a check that skips the test if the host CPU model is missing the > secure IPL facilities. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> > --- > tests/functional/s390x/test_secure_ipl.py | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/tests/functional/s390x/test_secure_ipl.py b/tests/functional/s390x/test_secure_ipl.py > index 06fc93e404..5af36b91d8 100755 > --- a/tests/functional/s390x/test_secure_ipl.py > +++ b/tests/functional/s390x/test_secure_ipl.py > @@ -29,6 +29,22 @@ def __init__(self, *args, **kwargs): > self.cert_path = None > self.prompt = None > > + def _require_host_secure_ipl_support(self, vm): > + """ > + Skip the test if the host CPU model does not expose the Secure IPL > + facilities (sipl, sclaf, cstore). > + """ > + props = vm.cmd('query-cpu-model-expansion', > + model={'name': 'host'}, > + type='full')['model']['props'] > + missing = [f for f in ('sipl', 'sclaf', 'cstore') > + if not props.get(f)] > + if missing: > + self.skipTest( > + f"Host CPU does not support Secure IPL: " > + f"missing feature(s): {', '.join(missing)}. " > + f"Secure IPL requires a z16+ host.") > + > def _create_certificate(self, vm): > """Generate x509 certificate""" > exec_command_and_wait_for_pattern(self, > @@ -107,6 +123,8 @@ def setup_s390x_secure_ipl(self): > '-device', 'virtio-blk-ccw,drive=drive0,bootindex=1') > temp_vm.launch() > > + self._require_host_secure_ipl_support(temp_vm) > + > # Initial root account setup (Fedora first boot screen) > self.root_password = 'fedora40password' > wait_for_console_pattern(self, 'Please make a selection from the above', Reviewed-by: Jared Rossi <jrossi@linux.ibm.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor 2026-08-12 15:21 ` [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor Joshua Daley 2026-08-17 20:01 ` Jared Rossi @ 2026-08-24 13:50 ` Matthew Rosato 2026-08-24 16:40 ` Zhuoying Cai 2 siblings, 0 replies; 14+ messages in thread From: Matthew Rosato @ 2026-08-24 13:50 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, richard.henderson, iii, david, cohuck On 8/12/26 11:21 AM, Joshua Daley wrote: > Currently, if secure IPL is not supported by the hypervisor, the test > will fail because "Verified component" never appears. One must inspect > the console log to observe the cause of the failure. > > Add a check that skips the test if the host CPU model is missing the > secure IPL facilities. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor 2026-08-12 15:21 ` [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor Joshua Daley 2026-08-17 20:01 ` Jared Rossi 2026-08-24 13:50 ` Matthew Rosato @ 2026-08-24 16:40 ` Zhuoying Cai 2 siblings, 0 replies; 14+ messages in thread From: Zhuoying Cai @ 2026-08-24 16:40 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, jrossi, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck Reviewed-by: Zhuoying Cai <zycai@linux.ibm.com> On 8/12/26 11:21 AM, Joshua Daley wrote: > Currently, if secure IPL is not supported by the hypervisor, the test > will fail because "Verified component" never appears. One must inspect > the console log to observe the cause of the failure. > > Add a check that skips the test if the host CPU model is missing the > secure IPL facilities. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> > --- > tests/functional/s390x/test_secure_ipl.py | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/tests/functional/s390x/test_secure_ipl.py b/tests/functional/s390x/test_secure_ipl.py > index 06fc93e404..5af36b91d8 100755 > --- a/tests/functional/s390x/test_secure_ipl.py > +++ b/tests/functional/s390x/test_secure_ipl.py > @@ -29,6 +29,22 @@ def __init__(self, *args, **kwargs): > self.cert_path = None > self.prompt = None > > + def _require_host_secure_ipl_support(self, vm): > + """ > + Skip the test if the host CPU model does not expose the Secure IPL > + facilities (sipl, sclaf, cstore). > + """ > + props = vm.cmd('query-cpu-model-expansion', > + model={'name': 'host'}, > + type='full')['model']['props'] > + missing = [f for f in ('sipl', 'sclaf', 'cstore') > + if not props.get(f)] > + if missing: > + self.skipTest( > + f"Host CPU does not support Secure IPL: " > + f"missing feature(s): {', '.join(missing)}. " > + f"Secure IPL requires a z16+ host.") > + > def _create_certificate(self, vm): > """Generate x509 certificate""" > exec_command_and_wait_for_pattern(self, > @@ -107,6 +123,8 @@ def setup_s390x_secure_ipl(self): > '-device', 'virtio-blk-ccw,drive=drive0,bootindex=1') > temp_vm.launch() > > + self._require_host_secure_ipl_support(temp_vm) > + > # Initial root account setup (Fedora first boot screen) > self.root_password = 'fedora40password' > wait_for_console_pattern(self, 'Please make a selection from the above', ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case 2026-08-12 15:21 [PATCH v1 0/3] Extend secure IPL support to virtio-blk-pci boot devices Joshua Daley 2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley 2026-08-12 15:21 ` [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor Joshua Daley @ 2026-08-12 15:21 ` Joshua Daley 2026-08-17 20:02 ` Jared Rossi 2026-08-24 14:55 ` Matthew Rosato 2 siblings, 2 replies; 14+ messages in thread From: Joshua Daley @ 2026-08-12 15:21 UTC (permalink / raw) To: qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck, jdaley Split test_s390x_secure_ipl() into two subtests. Each tests with a different boot device: virtio-blk-ccw or virtio-blk-pci. Use a state var such that the setup is run only once. Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> --- tests/functional/s390x/test_secure_ipl.py | 70 +++++++++++++++-------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/tests/functional/s390x/test_secure_ipl.py b/tests/functional/s390x/test_secure_ipl.py index 5af36b91d8..7fd4cfeaab 100755 --- a/tests/functional/s390x/test_secure_ipl.py +++ b/tests/functional/s390x/test_secure_ipl.py @@ -28,6 +28,7 @@ def __init__(self, *args, **kwargs): self.qcow2_path = None self.cert_path = None self.prompt = None + self.setup_done = False def _require_host_secure_ipl_support(self, vm): """ @@ -150,41 +151,64 @@ def setup_s390x_secure_ipl(self): # Shutdown temp vm temp_vm.shutdown() + self.setup_done = True - @skipBigDataTest() - def test_s390x_secure_ipl(self): + def verify_s390x_secure_ipl(self, boot_dev_bus: str): """ Verify secure boot validation during s390x guest boot. Expects two "Verified component" messages and confirms /sys/firmware/ipl/secure reports secure boot is active. """ - self.require_accelerator('kvm') - self.setup_s390x_secure_ipl() - - self.set_machine('s390-ccw-virtio') - - self.vm.set_console() - self.vm.add_args('-nographic', - '-machine', 's390-ccw-virtio,secure-boot=on,' - f'boot-certs.0.path={self.cert_path}', - '-accel', 'kvm', - '-m', '1024', - '-drive', - f'id=drive1,if=none,format=qcow2,file={self.qcow2_path}', - '-device', 'virtio-blk-ccw,drive=drive1,bootindex=1') - self.vm.launch() + if boot_dev_bus not in ['ccw', 'pci']: + raise ValueError( + f"boot_dev_bus must be 'ccw' or 'pci', got {boot_dev_bus}") + + vm = self.get_vm(name=f'sipl_test_vblk_{boot_dev_bus}') + vm.set_machine('s390-ccw-virtio') + + vm.set_console() + vm.add_args('-nographic', + '-machine', 's390-ccw-virtio,secure-boot=on,' + f'boot-certs.0.path={self.cert_path}', + '-accel', 'kvm', + '-m', '1024', + '-drive', + f'id=drive1,if=none,format=qcow2,file={self.qcow2_path}', + '-device', + f'virtio-blk-{boot_dev_bus},drive=drive1,bootindex=1') + vm.launch() # Expect two verified components verified_output = "Verified component" - wait_for_console_pattern(self, verified_output) - wait_for_console_pattern(self, verified_output) + wait_for_console_pattern(self, verified_output, vm=vm) + wait_for_console_pattern(self, verified_output, vm=vm) # Login and verify the vm is booted using secure boot - wait_for_console_pattern(self, 'localhost login:') - exec_command_and_wait_for_pattern(self, 'root', 'Password:') - exec_command_and_wait_for_pattern(self, self.root_password, self.prompt) - exec_command_and_wait_for_pattern(self, 'cat /sys/firmware/ipl/secure', '1') + wait_for_console_pattern(self, 'localhost login:', vm=vm) + exec_command_and_wait_for_pattern(self, 'root', 'Password:', vm=vm) + exec_command_and_wait_for_pattern( + self, self.root_password, self.prompt, vm=vm) + exec_command_and_wait_for_pattern( + self, 'cat /sys/firmware/ipl/secure', '1', vm=vm) + + vm.shutdown() + + @skipBigDataTest() + def test_s390x_secure_ipl_ccw(self): + """Test secure IPL with a virtio-blk-ccw boot device.""" + self.require_accelerator('kvm') + if not self.setup_done: + self.setup_s390x_secure_ipl() + self.verify_s390x_secure_ipl('ccw') + + @skipBigDataTest() + def test_s390x_secure_ipl_pci(self): + """Test secure IPL with a virtio-blk-pci boot device.""" + self.require_accelerator('kvm') + if not self.setup_done: + self.setup_s390x_secure_ipl() + self.verify_s390x_secure_ipl('pci') if __name__ == '__main__': QemuSystemTest.main() -- 2.34.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case 2026-08-12 15:21 ` [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case Joshua Daley @ 2026-08-17 20:02 ` Jared Rossi 2026-08-24 14:55 ` Matthew Rosato 1 sibling, 0 replies; 14+ messages in thread From: Jared Rossi @ 2026-08-17 20:02 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, zycai, borntraeger, jjherne, pasic, farman, mjrosato, richard.henderson, iii, david, cohuck On 8/12/26 11:21 AM, Joshua Daley wrote: > Split test_s390x_secure_ipl() into two subtests. Each tests with a > different boot device: virtio-blk-ccw or virtio-blk-pci. Use a state var > such that the setup is run only once. > > Signed-off-by: Joshua Daley <jdaley@linux.ibm.com> > --- > tests/functional/s390x/test_secure_ipl.py | 70 +++++++++++++++-------- > 1 file changed, 47 insertions(+), 23 deletions(-) > > diff --git a/tests/functional/s390x/test_secure_ipl.py b/tests/functional/s390x/test_secure_ipl.py > index 5af36b91d8..7fd4cfeaab 100755 > --- a/tests/functional/s390x/test_secure_ipl.py > +++ b/tests/functional/s390x/test_secure_ipl.py > @@ -28,6 +28,7 @@ def __init__(self, *args, **kwargs): > self.qcow2_path = None > self.cert_path = None > self.prompt = None > + self.setup_done = False > > def _require_host_secure_ipl_support(self, vm): > """ > @@ -150,41 +151,64 @@ def setup_s390x_secure_ipl(self): > > # Shutdown temp vm > temp_vm.shutdown() > + self.setup_done = True > > - @skipBigDataTest() > - def test_s390x_secure_ipl(self): > + def verify_s390x_secure_ipl(self, boot_dev_bus: str): > """ > Verify secure boot validation during s390x guest boot. > > Expects two "Verified component" messages and confirms > /sys/firmware/ipl/secure reports secure boot is active. > """ > - self.require_accelerator('kvm') > - self.setup_s390x_secure_ipl() > - > - self.set_machine('s390-ccw-virtio') > - > - self.vm.set_console() > - self.vm.add_args('-nographic', > - '-machine', 's390-ccw-virtio,secure-boot=on,' > - f'boot-certs.0.path={self.cert_path}', > - '-accel', 'kvm', > - '-m', '1024', > - '-drive', > - f'id=drive1,if=none,format=qcow2,file={self.qcow2_path}', > - '-device', 'virtio-blk-ccw,drive=drive1,bootindex=1') > - self.vm.launch() > + if boot_dev_bus not in ['ccw', 'pci']: > + raise ValueError( > + f"boot_dev_bus must be 'ccw' or 'pci', got {boot_dev_bus}") > + > + vm = self.get_vm(name=f'sipl_test_vblk_{boot_dev_bus}') > + vm.set_machine('s390-ccw-virtio') > + > + vm.set_console() > + vm.add_args('-nographic', > + '-machine', 's390-ccw-virtio,secure-boot=on,' > + f'boot-certs.0.path={self.cert_path}', > + '-accel', 'kvm', > + '-m', '1024', > + '-drive', > + f'id=drive1,if=none,format=qcow2,file={self.qcow2_path}', > + '-device', > + f'virtio-blk-{boot_dev_bus},drive=drive1,bootindex=1') > + vm.launch() > > # Expect two verified components > verified_output = "Verified component" > - wait_for_console_pattern(self, verified_output) > - wait_for_console_pattern(self, verified_output) > + wait_for_console_pattern(self, verified_output, vm=vm) > + wait_for_console_pattern(self, verified_output, vm=vm) > > # Login and verify the vm is booted using secure boot > - wait_for_console_pattern(self, 'localhost login:') > - exec_command_and_wait_for_pattern(self, 'root', 'Password:') > - exec_command_and_wait_for_pattern(self, self.root_password, self.prompt) > - exec_command_and_wait_for_pattern(self, 'cat /sys/firmware/ipl/secure', '1') > + wait_for_console_pattern(self, 'localhost login:', vm=vm) > + exec_command_and_wait_for_pattern(self, 'root', 'Password:', vm=vm) > + exec_command_and_wait_for_pattern( > + self, self.root_password, self.prompt, vm=vm) > + exec_command_and_wait_for_pattern( > + self, 'cat /sys/firmware/ipl/secure', '1', vm=vm) > + > + vm.shutdown() > + > + @skipBigDataTest() > + def test_s390x_secure_ipl_ccw(self): > + """Test secure IPL with a virtio-blk-ccw boot device.""" > + self.require_accelerator('kvm') > + if not self.setup_done: > + self.setup_s390x_secure_ipl() > + self.verify_s390x_secure_ipl('ccw') > + > + @skipBigDataTest() > + def test_s390x_secure_ipl_pci(self): > + """Test secure IPL with a virtio-blk-pci boot device.""" > + self.require_accelerator('kvm') > + if not self.setup_done: > + self.setup_s390x_secure_ipl() > + self.verify_s390x_secure_ipl('pci') > > if __name__ == '__main__': > QemuSystemTest.main() Reviewed-by: Jared Rossi <jrossi@linux.ibm.com> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case 2026-08-12 15:21 ` [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case Joshua Daley 2026-08-17 20:02 ` Jared Rossi @ 2026-08-24 14:55 ` Matthew Rosato 2026-08-24 16:38 ` Joshua Daley 1 sibling, 1 reply; 14+ messages in thread From: Matthew Rosato @ 2026-08-24 14:55 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, richard.henderson, iii, david, cohuck On 8/12/26 11:21 AM, Joshua Daley wrote: > Split test_s390x_secure_ipl() into two subtests. Each tests with a > different boot device: virtio-blk-ccw or virtio-blk-pci. Use a state var > such that the setup is run only once. [...] > + > + @skipBigDataTest() > + def test_s390x_secure_ipl_ccw(self): > + """Test secure IPL with a virtio-blk-ccw boot device.""" > + self.require_accelerator('kvm') > + if not self.setup_done: > + self.setup_s390x_secure_ipl() AFAICT this setup_done check won't do anything. If I run this file I will enter setup twice, once for test_secure_ipl.S390xSecureIpl.test_s390x_secure_ipl_ccw and again for test_secure_ipl.S390xSecureIpl.test_s390x_secure_ipl_pci I think it's because each test will run with it's own instance of the class. > + self.verify_s390x_secure_ipl('ccw') > + > + @skipBigDataTest() > + def test_s390x_secure_ipl_pci(self): > + """Test secure IPL with a virtio-blk-pci boot device.""" > + self.require_accelerator('kvm') > + if not self.setup_done: > + self.setup_s390x_secure_ipl() Same Unless this is really time consuming, I think the simple answer is to just let the setup run twice and don't try to share between the 2 instances? Thanks, Matt ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case 2026-08-24 14:55 ` Matthew Rosato @ 2026-08-24 16:38 ` Joshua Daley 2026-08-24 16:39 ` Matthew Rosato 0 siblings, 1 reply; 14+ messages in thread From: Joshua Daley @ 2026-08-24 16:38 UTC (permalink / raw) To: Matthew Rosato, qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, richard.henderson, iii, david, cohuck On 8/24/2026 10:55 AM, Matthew Rosato wrote: > On 8/12/26 11:21 AM, Joshua Daley wrote: >> Split test_s390x_secure_ipl() into two subtests. Each tests with a >> different boot device: virtio-blk-ccw or virtio-blk-pci. Use a state var >> such that the setup is run only once. > > [...] > >> + >> + @skipBigDataTest() >> + def test_s390x_secure_ipl_ccw(self): >> + """Test secure IPL with a virtio-blk-ccw boot device.""" >> + self.require_accelerator('kvm') >> + if not self.setup_done: >> + self.setup_s390x_secure_ipl() > > AFAICT this setup_done check won't do anything. > > If I run this file I will enter setup twice, once for > test_secure_ipl.S390xSecureIpl.test_s390x_secure_ipl_ccw > and again for > test_secure_ipl.S390xSecureIpl.test_s390x_secure_ipl_pci > > I think it's because each test will run with it's own instance of the class. > You're correct, good catch. >> + self.verify_s390x_secure_ipl('ccw') >> + >> + @skipBigDataTest() >> + def test_s390x_secure_ipl_pci(self): >> + """Test secure IPL with a virtio-blk-pci boot device.""" >> + self.require_accelerator('kvm') >> + if not self.setup_done: >> + self.setup_s390x_secure_ipl() > > Same > > Unless this is really time consuming, I think the simple answer is to > just let the setup run twice and don't try to share between the 2 instances? > > Thanks, > Matt > The setup is time consuming compared to the verification step. On my machine, the entire test takes about 120s, and about 90% of that is setup. A simple solution is to scrap the subtest idea and just have: @skipBigDataTest() def test_s390x_secure_ipl(self): self.require_accelerator('kvm') self.setup_s390x_secure_ipl() self.verify_s390x_secure_ipl('ccw') self.verify_s390x_secure_ipl('pci') But if we value separating the ccw and pci cases into separate subtests, I have a solution using setUpClass() and class-level vars to run the setup only once. It just makes the code a bit uglier. I'll proceed with it for v2, unless other opinions arise. Thanks. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case 2026-08-24 16:38 ` Joshua Daley @ 2026-08-24 16:39 ` Matthew Rosato 0 siblings, 0 replies; 14+ messages in thread From: Matthew Rosato @ 2026-08-24 16:39 UTC (permalink / raw) To: Joshua Daley, qemu-s390x Cc: qemu-devel, jrossi, zycai, borntraeger, jjherne, pasic, farman, richard.henderson, iii, david, cohuck >> Unless this is really time consuming, I think the simple answer is to >> just let the setup run twice and don't try to share between the 2 >> instances? >> >> Thanks, >> Matt >> > The setup is time consuming compared to the verification step. On my > machine, the entire test takes about 120s, and about 90% of that is setup. Bleh. OK, that seems worth the extra complexity. > > A simple solution is to scrap the subtest idea and just have: > > @skipBigDataTest() > def test_s390x_secure_ipl(self): > self.require_accelerator('kvm') > self.setup_s390x_secure_ipl() > self.verify_s390x_secure_ipl('ccw') > self.verify_s390x_secure_ipl('pci') > > But if we value separating the ccw and pci cases into separate subtests, > I have a solution using setUpClass() and class-level vars to run the > setup only once. It just makes the code a bit uglier. I'll proceed with > it for v2, unless other opinions arise. Sounds good. Thanks, Matt ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-08-24 16:40 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-12 15:21 [PATCH v1 0/3] Extend secure IPL support to virtio-blk-pci boot devices Joshua Daley 2026-08-12 15:21 ` [PATCH v1 1/3] hw/s390x/ipl: Add secure boot support to PCI dev IPLB builder Joshua Daley 2026-08-17 18:54 ` Jared Rossi 2026-08-17 19:34 ` Zhuoying Cai 2026-08-24 13:49 ` Matthew Rosato 2026-08-12 15:21 ` [PATCH v1 2/3] tests/functional/s390x/test_secure_ipl: Skip test if SIPL not supported by hypervisor Joshua Daley 2026-08-17 20:01 ` Jared Rossi 2026-08-24 13:50 ` Matthew Rosato 2026-08-24 16:40 ` Zhuoying Cai 2026-08-12 15:21 ` [PATCH v1 3/3] tests/functional/s390x/test_secure_ipl: Add virtio-blk-pci boot dev case Joshua Daley 2026-08-17 20:02 ` Jared Rossi 2026-08-24 14:55 ` Matthew Rosato 2026-08-24 16:38 ` Joshua Daley 2026-08-24 16:39 ` Matthew Rosato
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.