From nobody Sun Oct 5 01:47:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1757513479; cv=none; d=zohomail.com; s=zohoarc; b=Z8ybheS3NOxLXYJtgxgf2+Z/GZycs8G7Bz81dmN3hngQWaT1XN2maNDn0sEWdJCpFNKK28DwAFUToF0vsbV83CwzxPbj0lf5uXEfiOcN2QyoiLxsqJX+aZ/GCleASL9cBxBGiheBRUB9GR5KUbt0F5THt5OWFfnUcQKyL31pc8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757513479; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=hwa+KA8MjE3ZH30ICZVGH7kkSb97XKv4mkdqhN026rI=; b=CIGrh4oul8PFeKfB1bEoWpIX8exyq3Q20p12LHNJrVy1MeS3JaRoq4ZpqV6jgbZCgzAMPV1I8XFWkvZXPSEPFGcdW/M6oWKav5QOU6ynKQOFJT7D6cxAbQXZsZ0QRpJsWYiKNGBdgSypHW/lm//c2IQeZW/dxzTtVQ199U7YIYg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1757513479902604.5763137849362; Wed, 10 Sep 2025 07:11:19 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C5B5C41CA3; Wed, 10 Sep 2025 10:11:18 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id E749A44013; Wed, 10 Sep 2025 09:59:20 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7A73D43F0E; Wed, 10 Sep 2025 09:59:13 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id C8F3C43E1D for ; Wed, 10 Sep 2025 09:57:58 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-676-yERaGdxTMpeinz23oROdvw-1; Wed, 10 Sep 2025 09:57:57 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A1A4C1800295 for ; Wed, 10 Sep 2025 13:57:56 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.226.29]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D662B1800451 for ; Wed, 10 Sep 2025 13:57:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757512678; h=from:from: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; bh=hwa+KA8MjE3ZH30ICZVGH7kkSb97XKv4mkdqhN026rI=; b=gh7xZDqBX8v9baKdBV6i/B8eWv3Aq6l7qlZvlF1Iz0FjaHm/rX/CAB7554hjbqEhAZdOg0 9OhnFM/lUfpRWU4rDDvK+JDJSS30sF+eWL40/HVe/ru/ZFO8y5NYw8erMKI2HuriNbTZYT lUMEx1Qrkl5Os9lycBdMSVsm9QPEllU= X-MC-Unique: yERaGdxTMpeinz23oROdvw-1 X-Mimecast-MFC-AGG-ID: yERaGdxTMpeinz23oROdvw_1757512676 To: devel@lists.libvirt.org Subject: [PATCH v3 4/9] tests: Add tests for SEV firmware selection Date: Wed, 10 Sep 2025 15:57:42 +0200 Message-ID: <20250910135747.803614-5-abologna@redhat.com> In-Reply-To: <20250910135747.803614-1-abologna@redhat.com> References: <20250910135747.803614-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mX0BLmccWQFuc8YZEGGuyDn4-8D3aA9zMY8AxdcW-o0_1757512676 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 77LDSXFTAKBLXNYQGDW6ITH63SSEFIYI X-Message-ID-Hash: 77LDSXFTAKBLXNYQGDW6ITH63SSEFIYI X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1757513481565116600 Content-Type: text/plain; charset="utf-8"; x-default="true" One of the new test cases demonstrates how firmware autoselection doesn't currently work correctly for domains using SEV-SNP: the descriptor for a suitable firmware exists, and yet it doesn't get picked up. Another test cases shows that, while firmware autoselection succeeds for non-SNP SEV domains, the results are not the expected ones: the generic (stateful) edk2 build is used instead of the SEV-specific (stateless) one. Finally, one test case provides coverage for the uncommon scenario of stateful firmware being explicitly requested by the user. Signed-off-by: Andrea Bolognani Reviewed-by: Jim Fehlig --- ...-auto-efi-sev-snp.x86_64-latest+amdsev.err | 1 + ...-auto-efi-sev-snp.x86_64-latest+amdsev.xml | 38 ++++++++++++++++ .../firmware-auto-efi-sev-snp.xml | 20 +++++++++ ...efi-sev-stateful.x86_64-latest+amdsev.args | 37 ++++++++++++++++ ...-efi-sev-stateful.x86_64-latest+amdsev.xml | 43 +++++++++++++++++++ .../firmware-auto-efi-sev-stateful.xml | 21 +++++++++ ...are-auto-efi-sev.x86_64-latest+amdsev.args | 37 ++++++++++++++++ ...ware-auto-efi-sev.x86_64-latest+amdsev.xml | 43 +++++++++++++++++++ .../qemuxmlconfdata/firmware-auto-efi-sev.xml | 20 +++++++++ tests/qemuxmlconftest.c | 15 +++++++ 10 files changed, 275 insertions(+) create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-= latest+amdsev.err create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-= latest+amdsev.xml create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.xml create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev-stateful.x8= 6_64-latest+amdsev.args create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev-stateful.x8= 6_64-latest+amdsev.xml create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev-stateful.xml create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev.x86_64-late= st+amdsev.args create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev.x86_64-late= st+amdsev.xml create mode 100644 tests/qemuxmlconfdata/firmware-auto-efi-sev.xml diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-latest+= amdsev.err b/tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-latest+= amdsev.err new file mode 100644 index 0000000000..3edb2b3451 --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-latest+amdsev.= err @@ -0,0 +1 @@ +operation failed: Unable to find 'efi' firmware that is compatible with th= e current configuration diff --git a/tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-latest+= amdsev.xml b/tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-latest+= amdsev.xml new file mode 100644 index 0000000000..81ac7888ea --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-auto-efi-sev-snp.x86_64-latest+amdsev.= xml @@ -0,0 +1,38 @@ + + guest + 63840878-0deb-4095-97e6-fc444d9bc9fa + 1048576 + 1048576 + 1 + + hvm + + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + + +