From: Loh Yu Chen <lohyuchen@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Loh Yu Chen <lohyuchen@gmail.com>
Subject: [PATCH qemu-server] cpu config: sev: add attestation parameters
Date: Thu, 19 Mar 2026 20:10:35 +0800 [thread overview]
Message-ID: <20260319121034.527-2-lohyuchen@gmail.com> (raw)
The QEMU sev-guest object supports dh-cert-file and session-file parameters,
required for guest owner launch measurement attestation, but those are not
currently exposed.
These parameters are only applicable for type=std and type=es, as type=snp uses
a different attestation mechanism.
See https://www.qemu.org/docs/master/system/i386/amd-memory-encryption.html
Signed-off-by: Loh Yu Chen <lohyuchen@gmail.com>
---
src/PVE/QemuServer/CPUConfig.pm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/PVE/QemuServer/CPUConfig.pm b/src/PVE/QemuServer/CPUConfig.pm
index 32ec4954..8ae05b91 100644
--- a/src/PVE/QemuServer/CPUConfig.pm
+++ b/src/PVE/QemuServer/CPUConfig.pm
@@ -413,6 +413,20 @@ my $sev_fmt = {
default => 0,
optional => 1,
},
+ "dh-cert-file" => {
+ description => "Path to guest owner Diffie-Hellman certificate file for SEV(-ES) attestation"
+ . " (Ignored for SEV-SNP)",
+ type => 'string',
+ format_description => 'filepath',
+ optional => 1,
+ },
+ "session-file" => {
+ description => "Path to the session blob file generated by the guest owner for SEV(-ES) attestation"
+ . " (Ignored for SEV-SNP)",
+ type => 'string',
+ format_description => 'filepath',
+ optional => 1,
+ },
};
PVE::JSONSchema::register_format('pve-qemu-sev-fmt', $sev_fmt);
@@ -1173,6 +1187,20 @@ sub get_amd_sev_object {
$policy |= 1 << 2 if $amd_sev_conf->{type} eq 'es';
# disable migration with bit 3 nosend to prevent amd-sev-migration-attack
$policy |= 1 << 3;
+
+ if (defined($amd_sev_conf->{'dh-cert-file'}) xor defined($amd_sev_conf->{'session-file'})) {
+ die "dh-cert-file and session-file must be specified together.\n";
+ }
+ if (defined($amd_sev_conf->{'dh-cert-file'})) {
+ if (!-f $amd_sev_conf->{'dh-cert-file'}) {
+ die "dh-cert-file '$amd_sev_conf->{'dh-cert-file'}' does not exist.\n";
+ }
+ if (!-f $amd_sev_conf->{'session-file'}) {
+ die "session-file '$amd_sev_conf->{'session-file'}' does not exist.\n";
+ }
+ $sev_mem_object .= ',dh-cert-file=' . $amd_sev_conf->{'dh-cert-file'};
+ $sev_mem_object .= ',session-file=' . $amd_sev_conf->{'session-file'};
+ }
} elsif ($amd_sev_conf->{type} eq 'snp') {
$sev_mem_object .= 'sev-snp-guest,id=sev0';
$sev_mem_object .= ',cbitpos=' . $sev_hw_caps->{cbitpos};
--
2.53.0.windows.1
reply other threads:[~2026-03-20 7:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260319121034.527-2-lohyuchen@gmail.com \
--to=lohyuchen@gmail.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox