From: Tom Lendacky <thomas.lendacky@amd.com>
To: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
x86@kernel.org, linux-crypto@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Michael Roth <michael.roth@amd.com>,
Ashish Kalra <ashish.kalra@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Miller <davem@davemloft.net>
Subject: Re: [RFC PATCH 1/4] KVM: SEV: Publish supported SEV-SNP policy bits
Date: Wed, 10 Sep 2025 14:36:53 -0500 [thread overview]
Message-ID: <90e75fb2-7c29-dfef-7cc9-adb5d8566eb5@amd.com> (raw)
In-Reply-To: <aMHPT4AbJrGRNv05@google.com>
On 9/10/25 14:19, Sean Christopherson wrote:
> On Fri, Aug 22, 2025, Tom Lendacky wrote:
>> Define the set of policy bits that KVM currently knows as not requiring
>> any implementation support within KVM. Provide this value to userspace
>> via the KVM_GET_DEVICE_ATTR ioctl.
>>
>> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
>> ---
>> arch/x86/include/uapi/asm/kvm.h | 1 +
>> arch/x86/kvm/svm/sev.c | 11 ++++++++++-
>> 2 files changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
>> index 0f15d683817d..90e9c4551fa6 100644
>> --- a/arch/x86/include/uapi/asm/kvm.h
>> +++ b/arch/x86/include/uapi/asm/kvm.h
>> @@ -468,6 +468,7 @@ struct kvm_sync_regs {
>> /* vendor-specific groups and attributes for system fd */
>> #define KVM_X86_GRP_SEV 1
>> # define KVM_X86_SEV_VMSA_FEATURES 0
>> +# define KVM_X86_SNP_POLICY_BITS 1
>>
>> struct kvm_vmx_nested_state_data {
>> __u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
>> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
>> index 2fbdebf79fbb..7e6ce092628a 100644
>> --- a/arch/x86/kvm/svm/sev.c
>> +++ b/arch/x86/kvm/svm/sev.c
>> @@ -78,6 +78,8 @@ static u64 sev_supported_vmsa_features;
>> SNP_POLICY_MASK_DEBUG | \
>> SNP_POLICY_MASK_SINGLE_SOCKET)
>>
>> +static u64 snp_supported_policy_bits;
>
> This can be __ro_after_init. Hmm, off topic, but I bet we can give most of the
In the current form, I agree. If/when we support dynamic SEV firmware
updates, we may want to re-evaluate the supported policy bits since
newer SEV firmware could have made new bits available.
Maybe instead we move the call to get the current SEV firmware supported
bits and ANDing of the KVM supported bits into sev_dev_get_attr() and
snp_launch_start()? The downside is it is possible that the supported
policy bits could change between the two calls by the VMM.
Thanks,
Tom
> variables confifugred by sev_hardware_setup() the same treatment. And really
> off topic, I have a patch somewhere to convert a bunch of KVM variables from
> __read_mostly to __ro_after_init...
next prev parent reply other threads:[~2025-09-10 19:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 21:25 [RFC PATCH 0/4] SEV-SNP guest policy bit support updates Tom Lendacky
2025-08-22 21:25 ` [RFC PATCH 1/4] KVM: SEV: Publish supported SEV-SNP policy bits Tom Lendacky
2025-09-10 19:19 ` Sean Christopherson
2025-09-10 19:36 ` Tom Lendacky [this message]
2025-08-22 21:25 ` [RFC PATCH 2/4] KVM: SEV: Consolidate the SEV policy bits in a single header file Tom Lendacky
2025-08-22 21:25 ` [RFC PATCH 3/4] crypto: ccp - Add an API to return the supported SEV-SNP policy bits Tom Lendacky
2025-09-10 19:22 ` Sean Christopherson
2025-08-22 21:25 ` [RFC PATCH 4/4] KVM: SEV: Add known " Tom Lendacky
2025-09-10 19:23 ` [RFC PATCH 0/4] SEV-SNP guest policy bit support updates Sean Christopherson
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=90e75fb2-7c29-dfef-7cc9-adb5d8566eb5@amd.com \
--to=thomas.lendacky@amd.com \
--cc=ashish.kalra@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kvm@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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