From nobody Sun Feb 8 14:51:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1625777873840721.4762771961433; Thu, 8 Jul 2021 13:57:53 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-_nCg831mNRKkzK-_8vsYow-1; Thu, 08 Jul 2021 16:57:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01229192D787; Thu, 8 Jul 2021 20:57:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D606F60861; Thu, 8 Jul 2021 20:57:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 538991809C99; Thu, 8 Jul 2021 20:57:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 168Kvg1W014118 for ; Thu, 8 Jul 2021 16:57:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id C613C20B899D; Thu, 8 Jul 2021 20:57:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C10AE20B899C for ; Thu, 8 Jul 2021 20:57:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0294A866DFC for ; Thu, 8 Jul 2021 20:57:39 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-RiKTJyadMYOnzWbhkmx5rQ-1; Thu, 08 Jul 2021 16:57:36 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168KXfBg064929; Thu, 8 Jul 2021 16:57:35 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39n28m0s92-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 16:57:35 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 168Kg7eA098468; Thu, 8 Jul 2021 16:57:34 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 39n28m0s87-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 16:57:34 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 168KnI2k013138; Thu, 8 Jul 2021 20:57:32 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 39jfh8tcdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 20:57:32 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 168KtYFj35717558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Jul 2021 20:55:34 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6787E4C052; Thu, 8 Jul 2021 20:57:29 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1AF574C04E; Thu, 8 Jul 2021 20:57:29 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.182]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 8 Jul 2021 20:57:29 +0000 (GMT) X-MC-Unique: _nCg831mNRKkzK-_8vsYow-1 X-MC-Unique: RiKTJyadMYOnzWbhkmx5rQ-1 From: Boris Fiuczynski To: libvir-list@redhat.com, danielhb413@gmail.com Subject: [PATCH v4 7/8] qemu: use common id lsec0 for launchSecurity Date: Thu, 8 Jul 2021 22:57:23 +0200 Message-Id: <20210708205724.14643-8-fiuczy@linux.ibm.com> In-Reply-To: <20210708205724.14643-1-fiuczy@linux.ibm.com> References: <20210708205724.14643-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Xch3fipEZ3ud9PaGVhppkI-mtqTTVzcO X-Proofpoint-ORIG-GUID: 2f-54Ww0KArWSPSqT6Wm3sATWK1rLENp X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-08_11:2021-07-08, 2021-07-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107080104 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: phrdina@redhat.com, pasic@linux.ibm.com, pkrempa@redhat.com, mhartmay@linux.ibm.com, shalini@linux.ibm.com, bwalk@linux.ibm.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1625777875319100003 Content-Type: text/plain; charset="utf-8" Use the common id 'lsec0' for all launchSecurity types in the QEMU command line construction. Signed-off-by: Boris Fiuczynski --- src/qemu/qemu_command.c | 10 +++++----- .../launch-security-s390-pv.s390x-latest.args | 4 ++-- ...curity-sev-missing-platform-info.x86_64-2.12.0.args | 4 ++-- .../launch-security-sev.x86_64-2.12.0.args | 4 ++-- .../launch-security-sev.x86_64-6.0.0.args | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 87621e8a2f..3c03ca8cdb 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6971,13 +6971,13 @@ qemuBuildMachineCommandLine(virCommand *cmd, switch ((virDomainLaunchSecurity) def->sec->sectype) { case VIR_DOMAIN_LAUNCH_SECURITY_SEV: if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_CONFIDENTAL_GUE= ST_SUPPORT)) { - virBufferAddLit(&buf, ",confidential-guest-support=3Dsev0"= ); + virBufferAddLit(&buf, ",confidential-guest-support=3Dlsec0= "); } else { - virBufferAddLit(&buf, ",memory-encryption=3Dsev0"); + virBufferAddLit(&buf, ",memory-encryption=3Dlsec0"); } break; case VIR_DOMAIN_LAUNCH_SECURITY_PV: - virBufferAddLit(&buf, ",confidential-guest-support=3Dpv0"); + virBufferAddLit(&buf, ",confidential-guest-support=3Dlsec0"); break; case VIR_DOMAIN_LAUNCH_SECURITY_NONE: break; @@ -9853,7 +9853,7 @@ qemuBuildSEVCommandLine(virDomainObj *vm, virCommand = *cmd, if (sev->session) sessionpath =3D g_strdup_printf("%s/session.base64", priv->libDir); =20 - if (qemuMonitorCreateObjectProps(&props, "sev-guest", "sev0", + if (qemuMonitorCreateObjectProps(&props, "sev-guest", "lsec0", "u:cbitpos", sev->cbitpos, "u:reduced-phys-bits", sev->reduced_p= hys_bits, "u:policy", sev->policy, @@ -9878,7 +9878,7 @@ qemuBuildPVCommandLine(virDomainObj *vm, virCommand *= cmd) g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; qemuDomainObjPrivate *priv =3D vm->privateData; =20 - if (qemuMonitorCreateObjectProps(&props, "s390-pv-guest", "pv0", + if (qemuMonitorCreateObjectProps(&props, "s390-pv-guest", "lsec0", NULL) < 0) return -1; =20 diff --git a/tests/qemuxml2argvdata/launch-security-s390-pv.s390x-latest.ar= gs b/tests/qemuxml2argvdata/launch-security-s390-pv.s390x-latest.args index c9d9b84dd3..cb0dac0149 100644 --- a/tests/qemuxml2argvdata/launch-security-s390-pv.s390x-latest.args +++ b/tests/qemuxml2argvdata/launch-security-s390-pv.s390x-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -name guest=3DQEMUGuest1,debug-threads=3Don \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ --machine s390-ccw-virtio,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,confi= dential-guest-support=3Dpv0,memory-backend=3Ds390.ram \ +-machine s390-ccw-virtio,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,confi= dential-guest-support=3Dlsec0,memory-backend=3Ds390.ram \ -cpu gen15a-base,aen=3Don,cmmnt=3Don,vxpdeh=3Don,aefsi=3Don,diag318=3Don,c= sske=3Don,mepoch=3Don,msa9=3Don,msa8=3Don,msa7=3Don,msa6=3Don,msa5=3Don,msa= 4=3Don,msa3=3Don,msa2=3Don,msa1=3Don,sthyi=3Don,edat=3Don,ri=3Don,deflate= =3Don,edat2=3Don,etoken=3Don,vx=3Don,ipter=3Don,mepochptff=3Don,ap=3Don,vxe= h=3Don,vxpd=3Don,esop=3Don,msa9_pckmo=3Don,vxeh2=3Don,esort=3Don,apqi=3Don,= apft=3Don,els=3Don,iep=3Don,apqci=3Don,cte=3Don,ais=3Don,bpb=3Don,gs=3Don,p= pa15=3Don,zpci=3Don,sea_esop2=3Don,te=3Don,cmm=3Don \ -m 214 \ -object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264= }' \ @@ -30,6 +30,6 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -device virtio-blk-ccw,devno=3Dfe.0.0000,drive=3Dlibvirt-1-format,id=3Dvir= tio-disk0,bootindex=3D1 \ -audiodev id=3Daudio1,driver=3Dnone \ -device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0001 \ --object '{"qom-type":"s390-pv-guest","id":"pv0"}' \ +-object '{"qom-type":"s390-pv-guest","id":"lsec0"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/launch-security-sev-missing-platform-in= fo.x86_64-2.12.0.args b/tests/qemuxml2argvdata/launch-security-sev-missing-= platform-info.x86_64-2.12.0.args index 4e281e2e59..daa271c35c 100644 --- a/tests/qemuxml2argvdata/launch-security-sev-missing-platform-info.x86_= 64-2.12.0.args +++ b/tests/qemuxml2argvdata/launch-security-sev-missing-platform-info.x86_= 64-2.12.0.args @@ -11,7 +11,7 @@ QEMU_AUDIO_DRV=3Dnone \ -name guest=3DQEMUGuest1,debug-threads=3Don \ -S \ -object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ --machine pc-1.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,memory-encrypt= ion=3Dsev0 \ +-machine pc-1.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,memory-encrypt= ion=3Dlsec0 \ -m 214 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ @@ -28,6 +28,6 @@ QEMU_AUDIO_DRV=3Dnone \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --object sev-guest,id=3Dsev0,cbitpos=3D47,reduced-phys-bits=3D1,policy=3D1,= dh-cert-file=3D/tmp/lib/domain--1-QEMUGuest1/dh_cert.base64,session-file=3D= /tmp/lib/domain--1-QEMUGuest1/session.base64 \ +-object sev-guest,id=3Dlsec0,cbitpos=3D47,reduced-phys-bits=3D1,policy=3D1= ,dh-cert-file=3D/tmp/lib/domain--1-QEMUGuest1/dh_cert.base64,session-file= =3D/tmp/lib/domain--1-QEMUGuest1/session.base64 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/launch-security-sev.x86_64-2.12.0.args = b/tests/qemuxml2argvdata/launch-security-sev.x86_64-2.12.0.args index 40f79d377b..818d29be9f 100644 --- a/tests/qemuxml2argvdata/launch-security-sev.x86_64-2.12.0.args +++ b/tests/qemuxml2argvdata/launch-security-sev.x86_64-2.12.0.args @@ -11,7 +11,7 @@ QEMU_AUDIO_DRV=3Dnone \ -name guest=3DQEMUGuest1,debug-threads=3Don \ -S \ -object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ --machine pc-i440fx-2.12,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,memory= -encryption=3Dsev0 \ +-machine pc-i440fx-2.12,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,memory= -encryption=3Dlsec0 \ -m 214 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ @@ -28,6 +28,6 @@ QEMU_AUDIO_DRV=3Dnone \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0,b= ootindex=3D1 \ --object sev-guest,id=3Dsev0,cbitpos=3D47,reduced-phys-bits=3D1,policy=3D1,= dh-cert-file=3D/tmp/lib/domain--1-QEMUGuest1/dh_cert.base64,session-file=3D= /tmp/lib/domain--1-QEMUGuest1/session.base64 \ +-object sev-guest,id=3Dlsec0,cbitpos=3D47,reduced-phys-bits=3D1,policy=3D1= ,dh-cert-file=3D/tmp/lib/domain--1-QEMUGuest1/dh_cert.base64,session-file= =3D/tmp/lib/domain--1-QEMUGuest1/session.base64 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/launch-security-sev.x86_64-6.0.0.args b= /tests/qemuxml2argvdata/launch-security-sev.x86_64-6.0.0.args index f3330719dd..f2bb147a14 100644 --- a/tests/qemuxml2argvdata/launch-security-sev.x86_64-6.0.0.args +++ b/tests/qemuxml2argvdata/launch-security-sev.x86_64-6.0.0.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -name guest=3DQEMUGuest1,debug-threads=3Don \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ --machine pc-i440fx-6.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,confide= ntial-guest-support=3Dsev0,memory-backend=3Dpc.ram \ +-machine pc-i440fx-6.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,confide= ntial-guest-support=3Dlsec0,memory-backend=3Dpc.ram \ -cpu qemu64 \ -m 214 \ -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ @@ -31,6 +31,6 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ","file":"libvirt-1-storage"}' \ -device ide-hd,bus=3Dide.0,unit=3D0,drive=3Dlibvirt-1-format,id=3Dide0-0-0= ,bootindex=3D1 \ -audiodev id=3Daudio1,driver=3Dnone \ --object '{"qom-type":"sev-guest","id":"sev0","cbitpos":47,"reduced-phys-bi= ts":1,"policy":1,"dh-cert-file":"/tmp/lib/domain--1-QEMUGuest1/dh_cert.base= 64","session-file":"/tmp/lib/domain--1-QEMUGuest1/session.base64"}' \ +-object '{"qom-type":"sev-guest","id":"lsec0","cbitpos":47,"reduced-phys-b= its":1,"policy":1,"dh-cert-file":"/tmp/lib/domain--1-QEMUGuest1/dh_cert.bas= e64","session-file":"/tmp/lib/domain--1-QEMUGuest1/session.base64"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don --=20 2.31.1