{"id":2233190,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2233190/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505201905.997996-21-zycai@linux.ibm.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.2/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260505201905.997996-21-zycai@linux.ibm.com>","list_archive_url":null,"date":"2026-05-05T20:18:52","name":"[v11,20/32] pc-bios/s390-ccw: Introduce ZiplBootMode enum for IPL mode selection","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c6e52e090d54bff87174ff3375acfbc28468034a","submitter":{"id":90643,"url":"http://patchwork.ozlabs.org/api/1.2/people/90643/?format=json","name":"Zhuoying Cai","email":"zycai@linux.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505201905.997996-21-zycai@linux.ibm.com/mbox/","series":[{"id":502896,"url":"http://patchwork.ozlabs.org/api/1.2/series/502896/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502896","date":"2026-05-05T20:18:37","name":"Secure IPL Support for SCSI Scheme of virtio-blk/virtio-scsi Devices","version":11,"mbox":"http://patchwork.ozlabs.org/series/502896/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2233190/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2233190/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=AcqQBuhC;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g990N3GRZz1yJx\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 06:21:56 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wKMFb-0000M4-4f; Tue, 05 May 2026 16:20:15 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zycai@linux.ibm.com>)\n id 1wKMFF-00080U-1s; Tue, 05 May 2026 16:19:53 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zycai@linux.ibm.com>)\n id 1wKMFC-0000In-MY; Tue, 05 May 2026 16:19:52 -0400","from pps.filterd (m0360083.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 645E2erA1880225; Tue, 5 May 2026 20:19:47 GMT","from ppma21.wdc07v.mail.ibm.com\n (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dw9v7dnq6-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Tue, 05 May 2026 20:19:46 +0000 (GMT)","from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1])\n by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 645K9R3M002877;\n Tue, 5 May 2026 20:19:45 GMT","from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9])\n by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dwvkju9wv-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Tue, 05 May 2026 20:19:45 +0000 (GMT)","from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com\n [10.39.53.229])\n by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 645KJi0g12124926\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Tue, 5 May 2026 20:19:44 GMT","from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 173695805B;\n Tue,  5 May 2026 20:19:44 +0000 (GMT)","from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 6F1F958059;\n Tue,  5 May 2026 20:19:42 +0000 (GMT)","from fedora-workstation.pok.ibm.com (unknown [9.12.79.241])\n by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP;\n Tue,  5 May 2026 20:19:42 +0000 (GMT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n :content-transfer-encoding:date:from:in-reply-to:message-id\n :mime-version:references:subject:to; s=pp1; bh=iJLWvidALTZbMI4OK\n S/H5fVA5cAjEQcmSHJMOXxAJrM=; b=AcqQBuhCucihrLoEq3TvObOFB4odMy77p\n Jxha9m9cq2vmX4PIHtlof8Ulf821DGqdGaCGDrCBYpF374PJp5DRkkLF8M7uRZdz\n kB12M3/CKYSC+yhnPiJelpq7C+KYKEmF4fDwLA9SpJxyMKjw/lGZLKeYQcfGR5+M\n QP9GuR40YvkIBVML6a1l2253mcCSCSjDR0mt/ldmouDXi7o10ChtMrZ+F+KvbQcr\n k8hAcm2glBF9lca8NuPH0YGu/kfxfaN0kO6BUyIpsTdWKDq3leZKszkfNSSJeEaE\n pY3UHnKU6oI6wQYgcbIF2QOR0EEGtzwZNcATpOFui7dxutz1GsBOg==","From":"Zhuoying Cai <zycai@linux.ibm.com>","To":"qemu-s390x@nongnu.org, qemu-devel@nongnu.org","Cc":"jrossi@linux.ibm.com, cohuck@redhat.com, berrange@redhat.com,\n richard.henderson@linaro.org, david@kernel.org, walling@linux.ibm.com,\n jjherne@linux.ibm.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com,\n farman@linux.ibm.com, mjrosato@linux.ibm.com, iii@linux.ibm.com,\n eblake@redhat.com, armbru@redhat.com, zycai@linux.ibm.com,\n alifm@linux.ibm.com, brueckner@linux.ibm.com,\n pierrick.bouvier@oss.qualcomm.com, jdaley@linux.ibm.com","Subject":"[PATCH v11 20/32] pc-bios/s390-ccw: Introduce ZiplBootMode enum for\n IPL mode selection","Date":"Tue,  5 May 2026 16:18:52 -0400","Message-ID":"<20260505201905.997996-21-zycai@linux.ibm.com>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260505201905.997996-1-zycai@linux.ibm.com>","References":"<20260505201905.997996-1-zycai@linux.ibm.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNTA1MDE5NSBTYWx0ZWRfX2aKN+55hc8D8\n i0ZkSkYC7o5VBa9peYcnELzwyi+8A4q7GfnOWKSB12IxdZBIJZs7Pkx9/V2dwzWmhqce/qlF7Qx\n LoWDiFixiM9afu7DI+jd7FTEzC1RTdTucVqb18B+g5jZToLT/ZRegyc2sBzdWpfxbxl+RLYKsHo\n PakzzTPKqVgy/L8SKOTsmmudWjdJ9XE69NULyM1pREjkef2hP++s/jQYLBlksXOdkP+3k0/rQ06\n sjp6ob8IqWYSUjLmpRl2ZXDBgoOgBIl/kiWCh3+XS9vrAc3k/ASBotdfJEmYxJzW5UuKIJviVPb\n 9wz70DcB4G/r+2NkUJqMR6opsOmw++9wdApKgI2gwu1W0VHTK0XJ3+xVBUPSso+zqI6hK0lvdqQ\n FMn7I0l60R22V90L5ljoIeDmX7dnoWMzTriydvjlA2VaHt48jKmCt+v/XeOiEYvQhd9Cs5JEabM\n zQ6fNkr71qe5Zhn+QKA==","X-Proofpoint-GUID":"vNyWhMDxA42RO3Ee1KoKmS0LPUA02kY1","X-Proofpoint-ORIG-GUID":"vNyWhMDxA42RO3Ee1KoKmS0LPUA02kY1","X-Authority-Analysis":"v=2.4 cv=eu/vCIpX c=1 sm=1 tr=0 ts=69fa50e2 cx=c_pps\n a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17\n a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=OEmD_Q5Wy55prwwHBkMA:9","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-05-05_02,2026-04-30_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n priorityscore=1501 phishscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0\n suspectscore=0 malwarescore=0 bulkscore=0 impostorscore=0 spamscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605050195","Received-SPF":"pass client-ip=148.163.156.1; envelope-from=zycai@linux.ibm.com;\n helo=mx0a-001b2d01.pphosted.com","X-Spam_score_int":"-26","X-Spam_score":"-2.7","X-Spam_bar":"--","X-Spam_report":"(-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\n RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Add ZiplBootMode enumeration to support multiple IPL boot configurations.\nBoot modes differentiate between normal boot and secure IPL operations,\nenabled based on boot certificates specified via the boot-certs option.\n\nNormal Mode: IPL when no certificates are provided. No signature\nverification is performed.\n\nThis prepares for future secure IPL modes requiring signature\nverification.\n\nSigned-off-by: Zhuoying Cai <zycai@linux.ibm.com>\n---\n docs/system/s390x/secure-ipl.rst | 21 +++++++++++++++++++++\n pc-bios/s390-ccw/bootmap.c       | 16 +++++++++++++++-\n pc-bios/s390-ccw/main.c          |  6 ++++++\n pc-bios/s390-ccw/s390-ccw.h      |  6 ++++++\n 4 files changed, 48 insertions(+), 1 deletion(-)","diff":"diff --git a/docs/system/s390x/secure-ipl.rst b/docs/system/s390x/secure-ipl.rst\nindex 88df52ce2f..9d7d33f5ed 100644\n--- a/docs/system/s390x/secure-ipl.rst\n+++ b/docs/system/s390x/secure-ipl.rst\n@@ -18,3 +18,24 @@ Note: certificate files must have a .pem extension.\n .. code-block:: shell\n \n     qemu-system-s390x -machine s390-ccw-virtio,boot-certs.0.path=/.../qemu/certs,boot-certs.1.path=/another/path/cert.pem ...\n+\n+\n+IPL Modes\n+---------\n+\n+Multiple IPL modes are available to differentiate between the various IPL\n+configurations. These modes are mutually exclusive and enabled based on the\n+``boot-certs`` option on the QEMU command line.\n+\n+Normal Mode\n+^^^^^^^^^^^\n+\n+The absence of certificates will attempt to IPL a guest without secure IPL\n+operations. No checks are performed, and no warnings/errors are reported.\n+This is the default mode.\n+\n+Configuration:\n+\n+.. code-block:: shell\n+\n+    qemu-system-s390x -machine s390-ccw-virtio ...\ndiff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c\nindex b19981feb1..667a69f80d 100644\n--- a/pc-bios/s390-ccw/bootmap.c\n+++ b/pc-bios/s390-ccw/bootmap.c\n@@ -733,7 +733,14 @@ static int zipl_run(ScsiBlockPtr *pte)\n     /* Load image(s) into RAM */\n     entry = (ComponentEntry *)(&header[1]);\n \n-    rc = zipl_run_normal(&entry, tmp_sec);\n+    switch (boot_mode) {\n+    case ZIPL_BOOT_MODE_NORMAL:\n+        rc = zipl_run_normal(&entry, tmp_sec);\n+        break;\n+    default:\n+        panic(\"Unknown boot mode\");\n+    }\n+\n     if (rc) {\n         return rc;\n     }\n@@ -1105,12 +1112,16 @@ void zipl_load(void)\n     VDev *vdev = virtio_get_device();\n \n     if (vdev->is_cdrom) {\n+        IPL_assert((boot_mode == ZIPL_BOOT_MODE_NORMAL),\n+                   \"Secure boot from ISO image is not supported!\");\n         ipl_iso_el_torito();\n         puts(\"Failed to IPL this ISO image!\");\n         return;\n     }\n \n     if (virtio_get_device_type() == VIRTIO_ID_NET) {\n+        IPL_assert((boot_mode == ZIPL_BOOT_MODE_NORMAL),\n+                    \"Virtio net boot device does not support secure boot!\");\n         netmain();\n         puts(\"Failed to IPL from this network!\");\n         return;\n@@ -1121,6 +1132,9 @@ void zipl_load(void)\n         return;\n     }\n \n+    IPL_assert((boot_mode == ZIPL_BOOT_MODE_NORMAL),\n+                \"Secure boot with the ECKD scheme is not supported!\");\n+\n     switch (virtio_get_device_type()) {\n     case VIRTIO_ID_BLOCK:\n         zipl_load_vblk();\ndiff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c\nindex e6d4105786..66544f75f5 100644\n--- a/pc-bios/s390-ccw/main.c\n+++ b/pc-bios/s390-ccw/main.c\n@@ -30,6 +30,7 @@ IplParameterBlock *iplb;\n bool have_iplb;\n static uint16_t cutype;\n LowCore *lowcore; /* Yes, this *is* a pointer to address 0 */\n+ZiplBootMode boot_mode;\n \n #define LOADPARM_PROMPT \"PROMPT  \"\n #define LOADPARM_EMPTY  \"        \"\n@@ -303,6 +304,9 @@ static void ipl_ccw_device(void)\n     switch (cutype) {\n     case CU_TYPE_DASD_3990:\n     case CU_TYPE_DASD_2107:\n+        IPL_assert((boot_mode == ZIPL_BOOT_MODE_NORMAL),\n+                    \"Passthrough (vfio) CCW device does not support secure boot!\");\n+\n         dasd_ipl(blk_schid, cutype);\n         break;\n     case CU_TYPE_VIRTIO:\n@@ -390,6 +394,8 @@ void main(void)\n         probe_boot_device();\n     }\n \n+    boot_mode = ZIPL_BOOT_MODE_NORMAL;\n+\n     while (have_iplb) {\n         boot_setup();\n         if (have_iplb && find_boot_device()) {\ndiff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h\nindex 1e1f71775e..5420443ad2 100644\n--- a/pc-bios/s390-ccw/s390-ccw.h\n+++ b/pc-bios/s390-ccw/s390-ccw.h\n@@ -69,6 +69,12 @@ int sclp_read(char *str, size_t count);\n /* bootmap.c */\n void zipl_load(void);\n \n+typedef enum ZiplBootMode {\n+    ZIPL_BOOT_MODE_NORMAL = 0,\n+} ZiplBootMode;\n+\n+extern ZiplBootMode boot_mode;\n+\n /* jump2ipl.c */\n void write_reset_psw(uint64_t psw);\n int jump_to_IPL_code(uint64_t address);\n","prefixes":["v11","20/32"]}