{"id":2233195,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2233195/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505201905.997996-24-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-24-zycai@linux.ibm.com>","list_archive_url":null,"date":"2026-05-05T20:18:55","name":"[v11,23/32] s390x: Guest support for Secure-IPL Code Loading Attributes Facility (SCLAF)","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"4ee2f0698f7ed11062eb6ec116743016ec9daf2a","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-24-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/2233195/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2233195/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=ANWLxErC;\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 4g990b2NhQz1yJx\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 06:22:07 +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 1wKMFh-0000yq-Or; Tue, 05 May 2026 16:20:21 -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 1wKMFe-0000hW-Lw; Tue, 05 May 2026 16:20:18 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5])\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 1wKMFb-0000Jr-BQ; Tue, 05 May 2026 16:20:17 -0400","from pps.filterd (m0360072.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 645DxNDj1011760; Tue, 5 May 2026 20:19:51 GMT","from ppma23.wdc07v.mail.ibm.com\n (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dw9y4n72w-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Tue, 05 May 2026 20:19:51 +0000 (GMT)","from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1])\n by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 645K9Y8Z026723;\n Tue, 5 May 2026 20:19:50 GMT","from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72])\n by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dww3h38km-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Tue, 05 May 2026 20:19:50 +0000 (GMT)","from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com\n [10.39.53.229])\n by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 645KJnqV11469476\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Tue, 5 May 2026 20:19:49 GMT","from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 5645F5805C;\n Tue,  5 May 2026 20:19:49 +0000 (GMT)","from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id B02B458059;\n Tue,  5 May 2026 20:19:47 +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:47 +0000 (GMT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n :content-transfer-encoding:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=pp1; bh=MEYpTY\n 7jWNlc+J0rTGX1o0obC6qojnLZrejtfpPutr4=; b=ANWLxErCmnFvLDTKBunFAo\n GM+bzwQJy21EDEa+I5AHHNUt+9nonzM6W735YR9IJeyPdZUoTBhRSK+ZbwFAmaoY\n kf7GzosPPMyb97L1ItQfzChytB8RuBpKARY4mAw06e2MWsWkiMIt5odHnCWfkGTr\n 3OvmFDtHEetSwwrZPC+TrlG+wo1u5zYMMAF1MYfFToOKKUkzAbOGNKP+BWVxaA8J\n NW/yW2hqWaBv1e7FgfZC5RDehryr9sUOfVkywVraiEcOjcpJoShhDh7nF4+7PF1l\n HjwX7dznwgq+IvwpatTtHAOwD9J5UoDZneKf/BbDZHAJTyRjOS+j8rTKSt5QCcGw\n ==","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 23/32] s390x: Guest support for Secure-IPL Code Loading\n Attributes Facility (SCLAF)","Date":"Tue,  5 May 2026 16:18:55 -0400","Message-ID":"<20260505201905.997996-24-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-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNTA1MDE5NSBTYWx0ZWRfX1Qxn6zpjXMU/\n zB+Pm71djfrfWhMn5r9nsfgOXonNhJ6rBMRtaZ4CbSleVi0Z3TaLrCmiF6vKzohbIqbYyXy8RcF\n 7Ezb8e/tCAlTSMlenZlr2OYLC3ChRqWofny35RuYgkzNMjyHVrqmzlO0zPsEJYh7Lgcig1uFZqT\n Cfku+1ZQirwnUm/1XLpPe4+FqsfpY8iYrRtPM6RI3EC7GqyXoTxWIvOdMzwGd3XSlpjN7W8NAmM\n sekts+fHMgZdTHLW8xZldSX0gZYVhFxvKAci74INcMpgbUbHyTJYA+f/QSCbdrpi2gsBS/DFyWB\n zcNjs+l/WG6PiiAwC5MLJm9xj8Q4TG00EKkWKk0o8LRF20YK46faoyX33vXCwMk5F5FhDn0FTIX\n P0Xy2V9XFmCRyjVtcoldgHqeuYN16ovj5lcrXLb80W8qOqvUpmEnoW8N3rZHK7ydxwrJRVZd/eQ\n b4lCKsTo2vlrIGbLl/w==","X-Authority-Analysis":"v=2.4 cv=J4GaKgnS c=1 sm=1 tr=0 ts=69fa50e7 cx=c_pps\n a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17\n a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=RnoormkPH1_aCDwRdu11:22 a=RzCfie-kr_QcCd8fBx8p:22 a=VnNF1IyMAAAA:8\n a=s2GHSiDfQs-ooOV4uGMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10","X-Proofpoint-GUID":"rqCorioFzfWSuTLsmZgm9uGyP9cRHhzY","X-Proofpoint-ORIG-GUID":"rqCorioFzfWSuTLsmZgm9uGyP9cRHhzY","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 impostorscore=0 clxscore=1015 malwarescore=0 bulkscore=0 suspectscore=0\n priorityscore=1501 spamscore=0 phishscore=0 adultscore=0 lowpriorityscore=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.158.5; envelope-from=zycai@linux.ibm.com;\n helo=mx0b-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":"The secure-IPL-code-loading-attributes facility (SCLAF)\nprovides additional security during secure IPL.\n\nAvailability of SCLAF is determined by byte 136 bit 3 of the\nSCLP Read Info block.\n\nThis feature is available starting with the gen16 CPU model.\n\nSigned-off-by: Zhuoying Cai <zycai@linux.ibm.com>\nReviewed-by: Collin Walling <walling@linux.ibm.com>\n---\n docs/specs/s390x-secure-ipl.rst     | 18 ++++++++++++++++++\n target/s390x/cpu_features.c         |  2 ++\n target/s390x/cpu_features_def.h.inc |  1 +\n target/s390x/cpu_models.c           |  3 +++\n target/s390x/gen-features.c         |  2 ++\n target/s390x/kvm/kvm.c              |  1 +\n 6 files changed, 27 insertions(+)","diff":"diff --git a/docs/specs/s390x-secure-ipl.rst b/docs/specs/s390x-secure-ipl.rst\nindex c858d5b74b..5fc15be99c 100644\n--- a/docs/specs/s390x-secure-ipl.rst\n+++ b/docs/specs/s390x-secure-ipl.rst\n@@ -118,3 +118,21 @@ The guest kernel uses the contents in the IIRB for:\n * Boot logging: reports which components were loaded and verified.\n * kexec operations: builds the next kernel’s IPL report from the existing one.\n * Keying: installs IPL certificates into the platform trusted keyring.\n+\n+Secure Code Loading Attributes Facility\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+The Secure Code Loading Attributes Facility (SCLAF) enhances system security\n+during the IPL by enforcing additional verification rules.\n+\n+When SCLAF is available, its behavior depends on the IPL mode. It introduces\n+verification of both signed and unsigned components to help ensure that only\n+authorized code is loaded during the IPL process. Any errors detected by SCLAF\n+are reported in the IIRB.\n+\n+Unsigned components are restricted to load addresses at or above absolute\n+storage address ``0x2000``.\n+\n+Signed components must include a Secure Code Loading Attribute Block (SCLAB),\n+which is appended at the very end of the component. The SCLAB defines security\n+attributes for handling the signed code.\ndiff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c\nindex 200bd8c15b..29ea3bfec2 100644\n--- a/target/s390x/cpu_features.c\n+++ b/target/s390x/cpu_features.c\n@@ -120,6 +120,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,\n      * - All SIE facilities because SIE is not available\n      * - DIAG318\n      * - Secure IPL Facility\n+     * - Secure IPL Code Loading Attributes Facility\n      *\n      * As VMs can move in and out of protected mode the CPU model\n      * doesn't protect us from that problem because it is only\n@@ -152,6 +153,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,\n         break;\n     case S390_FEAT_TYPE_SCLP_FAC_IPL:\n         clear_be_bit(s390_feat_def(S390_FEAT_SIPL)->bit, data);\n+        clear_be_bit(s390_feat_def(S390_FEAT_SCLAF)->bit, data);\n         break;\n     default:\n         return;\ndiff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc\nindex bcf8a666e4..f6ba9e87e1 100644\n--- a/target/s390x/cpu_features_def.h.inc\n+++ b/target/s390x/cpu_features_def.h.inc\n@@ -142,6 +142,7 @@ DEF_FEAT(CERT_STORE, \"cstore\", SCLP_FAC134, 5, \"Certificate Store functions\")\n \n /* Features exposed via SCLP SCCB Facilities byte 136 - 137 (bit numbers relative to byte-136) */\n DEF_FEAT(SIPL, \"sipl\", SCLP_FAC_IPL, 1, \"Secure-IPL facility\")\n+DEF_FEAT(SCLAF, \"sclaf\", SCLP_FAC_IPL, 3, \"Secure-IPL-code-loading-attributes facility\")\n \n /* Features exposed via SCLP CPU info. */\n DEF_FEAT(SIE_F2, \"sief2\", SCLP_CPU, 4, \"SIE: interception format 2 (Virtual SIE)\")\ndiff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c\nindex a52e34aa95..7de727a256 100644\n--- a/target/s390x/cpu_models.c\n+++ b/target/s390x/cpu_models.c\n@@ -264,6 +264,7 @@ bool s390_has_feat(S390Feat feat)\n         case S390_FEAT_SIE_PFMFI:\n         case S390_FEAT_SIE_IBS:\n         case S390_FEAT_SIPL:\n+        case S390_FEAT_SCLAF:\n         case S390_FEAT_CONFIGURATION_TOPOLOGY:\n             return false;\n             break;\n@@ -509,6 +510,8 @@ static void check_consistency(const S390CPUModel *model)\n         { S390_FEAT_DIAG_318, S390_FEAT_EXTENDED_LENGTH_SCCB },\n         { S390_FEAT_CERT_STORE, S390_FEAT_EXTENDED_LENGTH_SCCB },\n         { S390_FEAT_SIPL, S390_FEAT_EXTENDED_LENGTH_SCCB },\n+        { S390_FEAT_SCLAF, S390_FEAT_EXTENDED_LENGTH_SCCB },\n+        { S390_FEAT_SCLAF, S390_FEAT_SIPL },\n         { S390_FEAT_NNPA, S390_FEAT_VECTOR },\n         { S390_FEAT_RDP, S390_FEAT_LOCAL_TLB_CLEARING },\n         { S390_FEAT_UV_FEAT_AP, S390_FEAT_AP },\ndiff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c\nindex bd2060ab93..c3e0c6ceff 100644\n--- a/target/s390x/gen-features.c\n+++ b/target/s390x/gen-features.c\n@@ -722,6 +722,7 @@ static uint16_t full_GEN16_GA1[] = {\n     S390_FEAT_UV_FEAT_AP_INTR,\n     S390_FEAT_CERT_STORE,\n     S390_FEAT_SIPL,\n+    S390_FEAT_SCLAF,\n };\n \n static uint16_t full_GEN17_GA1[] = {\n@@ -924,6 +925,7 @@ static uint16_t qemu_MAX[] = {\n     S390_FEAT_EXTENDED_LENGTH_SCCB,\n     S390_FEAT_CERT_STORE,\n     S390_FEAT_SIPL,\n+    S390_FEAT_SCLAF,\n };\n \n /****** END FEATURE DEFS ******/\ndiff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c\nindex e76ff37cc3..5417eb9b09 100644\n--- a/target/s390x/kvm/kvm.c\n+++ b/target/s390x/kvm/kvm.c\n@@ -2494,6 +2494,7 @@ bool kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp)\n \n     /* Some Secure IPL facilities are emulated by QEMU */\n     set_bit(S390_FEAT_SIPL, model->features);\n+    set_bit(S390_FEAT_SCLAF, model->features);\n \n     /* Test for Ultravisor features that influence secure guest behavior */\n     query_uv_feat_guest(model->features);\n","prefixes":["v11","23/32"]}