From nobody Mon Feb 9 15:06:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642187343; cv=none; d=zohomail.com; s=zohoarc; b=ETV4sWMTCOsUR8ztrb7OT92ghLS9opVVf96z+flvL9Gf1zFRa0JFDGWytsDpZMpDkRicEoVrxNxSZIOuFLdRgOw0a+5SFQrn32fJf/DZBvMKJRxiTHZFuJBbv6l55UFcNQmB1JCMEn3yXlGB074eYNwzoVAuKffuioZNHLPOXrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642187343; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WVu2JWN5LddE9oKesH6u7Ci5H7oJuuVbE2bMeiSLKrk=; b=W86VOSgeVMiB+4kWOpW3zL4WLo2CU0sX1O34PcVzomW6b8v0kr8Uv21Fuc8ciNwUonuuTeC7uXW6deVdPZE+TyJhLwqmGSPcZdF5NV369xLwLxyuvHYnR1jVJiegt36yY92oRKlh1QbmfwytW7nX0AdnEVMMSg2FlcvvF16s8i4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642187343115553.2724633721277; Fri, 14 Jan 2022 11:09:03 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-246-wkdTNc7jOD-4QzgRAJqotg-1; Fri, 14 Jan 2022 14:08:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63F03100F943; Fri, 14 Jan 2022 19:08:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3F29D2B178; Fri, 14 Jan 2022 19:08:40 +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 0E2A74A7C9; Fri, 14 Jan 2022 19:08:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20EJ8cYk023401 for ; Fri, 14 Jan 2022 14:08:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 771871037F36; Fri, 14 Jan 2022 19:08:38 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9368010013C1; Fri, 14 Jan 2022 19:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642187342; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=WVu2JWN5LddE9oKesH6u7Ci5H7oJuuVbE2bMeiSLKrk=; b=Yv5Megac388XsJYhmGUQPLyfWlAFr0lDaD55nnMMtXT8Qwc4+agDSjvjYfjA/8Q8z07z66 ZG8b7PeH3o4U4J5GZaDmJ05bQ6BYtDW8BJ9rVGRhmBd9mzdFmj2hLQe7MD/6puu1+SNt9w iflDsHWEML1fAByHsHh+emPK74OK0dY= X-MC-Unique: wkdTNc7jOD-4QzgRAJqotg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] tests: add a test for selecting a firmware without NVRAM Date: Fri, 14 Jan 2022 19:07:15 +0000 Message-Id: <20220114190715.128033-6-berrange@redhat.com> In-Reply-To: <20220114190715.128033-1-berrange@redhat.com> References: <20220114190715.128033-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.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.11 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642187343638100001 This demonstrates that when the XML config contains the firmware auto-selection code will ignore the high priority pflash OVMF builds tagged with the 'amd-sev' feature, and instead pick the ROM builds without a varstore. Signed-off-by: Daniel P. Berrang=C3=A9 --- .../os-firmware-efi-sev.x86_64-6.0.0.args | 43 +++++++++++ .../qemuxml2argvdata/os-firmware-efi-sev.xml | 74 +++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 118 insertions(+) create mode 100644 tests/qemuxml2argvdata/os-firmware-efi-sev.x86_64-6.0.0= .args create mode 100644 tests/qemuxml2argvdata/os-firmware-efi-sev.xml diff --git a/tests/qemuxml2argvdata/os-firmware-efi-sev.x86_64-6.0.0.args b= /tests/qemuxml2argvdata/os-firmware-efi-sev.x86_64-6.0.0.args new file mode 100644 index 0000000000..fdb64fef75 --- /dev/null +++ b/tests/qemuxml2argvdata/os-firmware-efi-sev.x86_64-6.0.0.args @@ -0,0 +1,43 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-fedora \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-fedora/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-fedora/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-fedora/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dfedora,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-fedora/master-key.aes"}' \ +-machine pc-q35-4.0,usb=3Doff,dump-guest-core=3Doff,confidential-guest-sup= port=3Dlsec0,memory-backend=3Dpc.ram \ +-accel kvm \ +-cpu qemu64 \ +-bios /usr/share/OVMF/OVMF.sev.fd \ +-m 8 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":8388608}' \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-global ICH9-LPC.disable_s3=3D0 \ +-global ICH9-LPC.disable_s4=3D1 \ +-boot menu=3Don,strict=3Don \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1e \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device ioh3420,port=3D8,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x1 \ +-device ich9-usb-ehci1,id=3Dusb,bus=3Dpcie.0,addr=3D0x1d.0x7 \ +-device ich9-usb-uhci1,masterbus=3Dusb.0,firstport=3D0,bus=3Dpcie.0,multif= unction=3Don,addr=3D0x1d \ +-device ich9-usb-uhci2,masterbus=3Dusb.0,firstport=3D2,bus=3Dpcie.0,addr= =3D0x1d.0x1 \ +-device ich9-usb-uhci3,masterbus=3Dusb.0,firstport=3D4,bus=3Dpcie.0,addr= =3D0x1d.0x2 \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.2,addr=3D0x1 \ +-object '{"qom-type":"sev-guest","id":"lsec0","cbitpos":47,"reduced-phys-b= its":1,"policy":1,"dh-cert-file":"/tmp/lib/domain--1-fedora/dh_cert.base64"= ,"session-file":"/tmp/lib/domain--1-fedora/session.base64"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/os-firmware-efi-sev.xml b/tests/qemuxml= 2argvdata/os-firmware-efi-sev.xml new file mode 100644 index 0000000000..eb8292b59d --- /dev/null +++ b/tests/qemuxml2argvdata/os-firmware-efi-sev.xml @@ -0,0 +1,74 @@ + + fedora + 63840878-0deb-4095-97e6-fc444d9bc9fa + 8192 + 8192 + 1 + + hvm + + + + + + + + + + + destroy + restart + restart + + + + + + /usr/bin/qemu-system-x86_64 + +
+ + + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + 47 + 1 + 0x0001 + AQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAAAQAAAAAOAAA + IHAVENOIDEABUTJUSTPROVIDINGASTRING + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index cc67d806e4..16765f2471 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3455,6 +3455,7 @@ mymain(void) DO_TEST_CAPS_LATEST("os-firmware-efi"); DO_TEST_CAPS_LATEST("os-firmware-efi-secboot"); DO_TEST_CAPS_LATEST("os-firmware-efi-no-enrolled-keys"); + DO_TEST_CAPS_VER("os-firmware-efi-sev", "6.0.0"); DO_TEST_CAPS_ARCH_LATEST("aarch64-os-firmware-efi", "aarch64"); =20 DO_TEST_CAPS_LATEST("vhost-user-vga"); --=20 2.33.1