[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9507220f-1552-4105-93e4-9485dc9500c8@redhat.com>
Date: Sat, 30 Mar 2024 21:20:28 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Michael Roth <michael.roth@....com>, kvm@...r.kernel.org
Cc: linux-coco@...ts.linux.dev, linux-mm@...ck.org,
linux-crypto@...r.kernel.org, x86@...nel.org, linux-kernel@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, jroedel@...e.de,
thomas.lendacky@....com, hpa@...or.com, ardb@...nel.org, seanjc@...gle.com,
vkuznets@...hat.com, jmattson@...gle.com, luto@...nel.org,
dave.hansen@...ux.intel.com, slp@...hat.com, pgonda@...gle.com,
peterz@...radead.org, srinivas.pandruvada@...ux.intel.com,
rientjes@...gle.com, dovmurik@...ux.ibm.com, tobin@....com, bp@...en8.de,
vbabka@...e.cz, kirill@...temov.name, ak@...ux.intel.com,
tony.luck@...el.com, sathyanarayanan.kuppuswamy@...ux.intel.com,
alpergun@...gle.com, jarkko@...nel.org, ashish.kalra@....com,
nikunj.dadhania@....com, pankaj.gupta@....com, liam.merwick@...cle.com,
Brijesh Singh <brijesh.singh@....com>
Subject: Re: [PATCH v12 10/29] KVM: SEV: Add KVM_SEV_SNP_LAUNCH_START command
On 3/29/24 23:58, Michael Roth wrote:
> From: Brijesh Singh <brijesh.singh@....com>
>
> KVM_SEV_SNP_LAUNCH_START begins the launch process for an SEV-SNP guest.
> The command initializes a cryptographic digest context used to construct
> the measurement of the guest. Other commands can then at that point be
> used to load/encrypt data into the guest's initial launch image.
Does KVM_SEV_LAUNCH_START fail for SNP guests, or should we take care of
forbidding it?
> + if (params.policy & SNP_POLICY_MASK_SINGLE_SOCKET) {
> + pr_debug("SEV-SNP hypervisor does not support limiting guests to a single socket.");
> + return -EINVAL;
> + }
> +
> + if (!(params.policy & SNP_POLICY_MASK_SMT)) {
> + pr_debug("SEV-SNP hypervisor does not support limiting guests to a single SMT thread.");
> + return -EINVAL;
> + }
Since you're forbidding some bits, KVM should also check that undefined
bits (63:25) are zero.
Also what about checking that the major version is equal to the one that
KVM supports? From the docs it's not even clear what ABI version they
document (QEMU uses 0).
Otherwise looks good.
Paolo
Powered by blists - more mailing lists