From: Eric Farman <farman@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Matthew Rosato <mjrosato@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
Zhuoying Cai <zycai@linux.ibm.com>,
Collin Walling <walling@linux.ibm.com>,
Eric Farman <farman@linux.ibm.com>
Subject: [PULL 31/37] pc-bios/s390-ccw: Handle true secure IPL mode
Date: Wed, 26 Aug 2026 08:52:06 -0400 [thread overview]
Message-ID: <20260826125213.1901252-32-farman@linux.ibm.com> (raw)
In-Reply-To: <20260826125213.1901252-1-farman@linux.ibm.com>
From: Zhuoying Cai <zycai@linux.ibm.com>
When secure boot is enabled (-secure-boot on) and certificate(s) are
provided, the boot operates in True Secure IPL mode.
Any verification error during True Secure IPL mode will cause the
entire boot process to terminate.
Secure IPL in audit mode requires at least one certificate provided in
the key store along with necessary facilities. If secure boot is enabled
but no certificate is provided, the boot process will also terminate, as
this is not a valid secure boot configuration.
Note: True Secure IPL mode is implemented for the SCSI scheme of
virtio-blk/virtio-scsi devices.
Signed-off-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20260730214624.2328883-30-zycai@linux.ibm.com
Signed-off-by: Eric Farman <farman@linux.ibm.com>
---
docs/system/s390x/secure-ipl.rst | 13 +++++++++++++
hw/s390x/ipl.c | 3 ++-
pc-bios/s390-ccw/bootmap.c | 6 +++++-
pc-bios/s390-ccw/main.c | 7 ++++++-
pc-bios/s390-ccw/s390-ccw.h | 1 +
pc-bios/s390-ccw/secure-ipl.h | 3 +++
6 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/docs/system/s390x/secure-ipl.rst b/docs/system/s390x/secure-ipl.rst
index 9e3955f8fc..c8fb887ac0 100644
--- a/docs/system/s390x/secure-ipl.rst
+++ b/docs/system/s390x/secure-ipl.rst
@@ -66,3 +66,16 @@ Configuration:
.. code-block:: shell
qemu-system-s390x -machine s390-ccw-virtio,boot-certs.0.path=/.../qemu/certs,boot-certs.1.path=/another/path/cert.pem ...
+
+Secure Mode
+^^^^^^^^^^^
+
+When the ``secure-boot=on`` option is set and certificates are provided,
+a secure boot is performed with error reporting enabled. The boot process aborts
+if any error occurs.
+
+Configuration:
+
+.. code-block:: shell
+
+ qemu-system-s390x -machine s390-ccw-virtio,secure-boot=on,boot-certs.0.path=/.../qemu/certs,boot-certs.1.path=/another/path/cert.pem ...
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 08294af4d0..35bdfe03d8 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -851,7 +851,8 @@ void s390_ipl_prepare_cpu(S390CPU *cpu)
* Secure IPL without specifying a boot device.
* IPLB is not generated if no boot device is defined.
*/
- if (s390_has_certificate() && !ipl->iplb_valid) {
+ if ((s390_has_certificate() || s390_secure_boot_enabled()) &&
+ !ipl->iplb_valid) {
error_report("No boot device defined for Secure IPL");
exit(1);
}
diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c
index 16c20313c8..9e0890f38d 100644
--- a/pc-bios/s390-ccw/bootmap.c
+++ b/pc-bios/s390-ccw/bootmap.c
@@ -743,6 +743,7 @@ static int zipl_run(ScsiBlockPtr *pte)
case ZIPL_BOOT_MODE_NORMAL:
rc = zipl_run_normal(&entry, tmp_sec);
break;
+ case ZIPL_BOOT_MODE_SECURE:
case ZIPL_BOOT_MODE_SECURE_AUDIT:
rc = zipl_run_secure(&entry, tmp_sec, &comp_list, &cert_list, &tmp_cert_buf);
break;
@@ -762,7 +763,8 @@ static int zipl_run(ScsiBlockPtr *pte)
write_reset_psw(entry->compdat.load_psw);
- if (boot_mode == ZIPL_BOOT_MODE_SECURE_AUDIT) {
+ if (boot_mode == ZIPL_BOOT_MODE_SECURE ||
+ boot_mode == ZIPL_BOOT_MODE_SECURE_AUDIT) {
update_cert_list(&cert_list);
update_iirb(&comp_list, &cert_list);
free(tmp_cert_buf);
@@ -1130,6 +1132,8 @@ ZiplBootMode get_boot_mode(uint8_t hdr_flags)
if (!sipl_set && iplir_set) {
return ZIPL_BOOT_MODE_SECURE_AUDIT;
+ } else if (sipl_set && iplir_set) {
+ return ZIPL_BOOT_MODE_SECURE;
}
return ZIPL_BOOT_MODE_NORMAL;
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 520c448c2c..c5c093534c 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -402,15 +402,20 @@ void main(void)
boot_mode = get_boot_mode(iplb->hdr_flags);
switch (boot_mode) {
+ case ZIPL_BOOT_MODE_SECURE:
case ZIPL_BOOT_MODE_SECURE_AUDIT:
if (!secure_ipl_supported()) {
- panic("Unable to boot in audit mode");
+ panic("Unable to boot in secure/audit mode");
}
vcssb_len = zipl_secure_get_vcssb();
if (vcssb_len == 0) {
panic("Failed to query certificate storage information!");
}
+
+ if (vcssb_len == VCSSB_NO_VC) {
+ panic("Need at least one certificate for secure boot!");
+ }
break;
default:
break;
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index 64584dc8a7..b2afc155d2 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -90,6 +90,7 @@ void zipl_load(void);
typedef enum ZiplBootMode {
ZIPL_BOOT_MODE_NORMAL = 0,
ZIPL_BOOT_MODE_SECURE_AUDIT = 1,
+ ZIPL_BOOT_MODE_SECURE = 2,
} ZiplBootMode;
extern ZiplBootMode boot_mode;
diff --git a/pc-bios/s390-ccw/secure-ipl.h b/pc-bios/s390-ccw/secure-ipl.h
index ce354b4d6a..4908245b9b 100644
--- a/pc-bios/s390-ccw/secure-ipl.h
+++ b/pc-bios/s390-ccw/secure-ipl.h
@@ -59,6 +59,9 @@ static inline void zipl_secure_error(const char *message)
case ZIPL_BOOT_MODE_SECURE_AUDIT:
printf("AUDIT MODE WARNING: %s\n", message);
break;
+ case ZIPL_BOOT_MODE_SECURE:
+ panic(message);
+ break;
default:
/*
* Errors are intentionally ignored in non-secure boot modes.
--
2.55.0
next prev parent reply other threads:[~2026-08-26 12:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 12:51 [PULL 00/37] s390x queue Eric Farman
2026-08-26 12:51 ` [PULL 01/37] s390x/sclp: pv: only copy the original SCCB buffer Eric Farman
2026-08-26 12:51 ` [PULL 02/37] s390x/css: Fix css stsch detection to go beyond 8192 devices Eric Farman
2026-08-26 12:51 ` [PULL 03/37] Add boot-certs to s390-ccw-virtio machine type option Eric Farman
2026-08-26 12:51 ` [PULL 04/37] crypto/x509-utils: Refactor with GNUTLS fallback Eric Farman
2026-08-26 12:51 ` [PULL 05/37] crypto/x509-utils: Add helper functions for certificate store Eric Farman
2026-08-26 12:51 ` [PULL 06/37] hw/s390x/ipl: Create " Eric Farman
2026-08-26 12:51 ` [PULL 07/37] s390x/diag: Introduce DIAG 320 for Certificate Store Facility Eric Farman
2026-08-26 12:51 ` [PULL 08/37] s390x/diag: Refactor address validation check from diag308_parm_check Eric Farman
2026-08-26 12:51 ` [PULL 09/37] s390x/diag: Implement DIAG 320 subcode 1 Eric Farman
2026-08-26 12:51 ` [PULL 10/37] crypto/x509-utils: Add helper functions for DIAG 320 subcode 2 Eric Farman
2026-08-26 12:51 ` [PULL 11/37] s390x/diag: Implement " Eric Farman
2026-08-26 12:51 ` [PULL 12/37] hw/s390x: Define finite size for single entry VCEntry Eric Farman
2026-08-26 12:51 ` [PULL 13/37] s390x/diag: Introduce DIAG 508 for secure IPL operations Eric Farman
2026-08-26 12:51 ` [PULL 14/37] crypto/x509-utils: Add helper functions for DIAG 508 subcode 1 Eric Farman
2026-08-26 12:51 ` [PULL 15/37] s390x/diag: Generalize s390_ipl_read/write to accept void * Eric Farman
2026-08-26 12:51 ` [PULL 16/37] s390x/diag: Implement DIAG 508 subcode 1 for signature verification Eric Farman
2026-08-26 12:51 ` [PULL 17/37] s390x/ipl: Introduce IPL Information Report Block (IIRB) Eric Farman
2026-08-26 12:51 ` [PULL 18/37] pc-bios/s390-ccw: Define memory for IPLB and convert IPLB to pointers Eric Farman
2026-08-26 12:51 ` [PULL 19/37] hw/s390x/ipl: Add IPIB flags to IPL Parameter Block Eric Farman
2026-08-26 12:51 ` [PULL 20/37] hw/s390x/ipl: Rework s390_ipl_map_iplb_chain for certificate storage Eric Farman
2026-08-26 12:51 ` [PULL 21/37] s390x: Guest support for Secure-IPL Facility Eric Farman
2026-08-26 12:51 ` [PULL 22/37] pc-bios/s390-ccw: Refactor zipl_run() Eric Farman
2026-08-26 12:51 ` [PULL 23/37] pc-bios/s390-ccw: Rework zipl_load_segment function Eric Farman
2026-08-26 12:51 ` [PULL 24/37] pc-bios/s390-ccw: Introduce ZiplBootMode enum for IPL mode selection Eric Farman
2026-08-26 12:52 ` [PULL 25/37] pc-bios/s390-ccw: Add signature verification for secure IPL in audit mode Eric Farman
2026-08-26 12:52 ` [PULL 26/37] pc-bios/s390-ccw: Add signed component address overlap checks Eric Farman
2026-08-26 12:52 ` [PULL 27/37] s390x: Guest support for Secure-IPL Code Loading Attributes Facility (SCLAF) Eric Farman
2026-08-26 12:52 ` [PULL 28/37] pc-bios/s390-ccw: Add additional security checks for secure boot Eric Farman
2026-08-26 12:52 ` [PULL 29/37] Add secure-boot to s390-ccw-virtio machine type option Eric Farman
2026-08-26 12:52 ` [PULL 30/37] hw/s390x/ipl: Set IPIB flags for secure IPL Eric Farman
2026-08-26 12:52 ` Eric Farman [this message]
2026-08-26 12:52 ` [PULL 32/37] hw/s390x/ipl: Handle secure boot with multiple boot devices Eric Farman
2026-08-26 12:52 ` [PULL 33/37] tests/functional/s390x: Add secure IPL functional test Eric Farman
2026-08-26 12:52 ` [PULL 34/37] docs/specs: Add secure IPL documentation Eric Farman
2026-08-26 12:52 ` [PULL 35/37] docs/system/s390x: " Eric Farman
2026-08-26 12:52 ` [PULL 36/37] MAINTAINERS: Add secure IPL files to S390-ccw boot group Eric Farman
2026-08-26 12:52 ` [PULL 37/37] pc-bios/s390-ccw.img: update s390x bios Eric Farman
2026-08-27 4:18 ` [PULL 00/37] s390x queue Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260826125213.1901252-32-farman@linux.ibm.com \
--to=farman@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=mjrosato@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=walling@linux.ibm.com \
--cc=zycai@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.