From: Tom Lendacky <thomas.lendacky@amd.com>
To: "Kalra, Ashish" <ashish.kalra@amd.com>,
"Paluri, PavanKumar" <papaluri@amd.com>,
seanjc@google.com, pbonzini@redhat.com, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
shuah@kernel.org, prsampat@amd.com
Cc: pgonda@google.com, nikunj@amd.com, pankaj.gupta@amd.com,
michael.roth@amd.com, sraithal@amd.com,
linux-kernel@vger.kernel.org, x86@kernel.org,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-coco@lists.linux.dev, "Paluri,
PavanKumar (Pavan Kumar)" <pavankumar.paluri@amd.com>
Subject: Re: [PATCH] KVM: SEV: Disable SEV-SNP support on initialization failure
Date: Fri, 9 May 2025 12:57:39 -0500 [thread overview]
Message-ID: <2d6b64ae-eca7-ae1d-1695-4c2697a60616@amd.com> (raw)
In-Reply-To: <e71453cd-3d7d-4c7b-b763-3e47236ac955@amd.com>
On 5/9/25 12:52, Kalra, Ashish wrote:
>
> On 5/9/2025 12:01 PM, Paluri, PavanKumar wrote:
>>
>>
>> On 5/8/2025 5:52 PM, Ashish Kalra wrote:
>>> From: Ashish Kalra <ashish.kalra@amd.com>
>>>
>>> During platform init, SNP initialization may fail for several reasons,
>>> such as firmware command failures and incompatible versions. However,
>>> the KVM capability may continue to advertise support for it.
>>>
>>> The platform may have SNP enabled but if SNP_INIT fails then SNP is
>>> not supported by KVM.
>>>
>>> During KVM module initialization query the SNP platform status to obtain
>>> the SNP initialization state and use it as an additional condition to
>>> determine support for SEV-SNP.
>>>
>>> Co-developed-by: Sean Christopherson <seanjc@google.com>
>>> Signed-off-by: Sean Christopherson <seanjc@google.com>
>>> Co-developed-by: Pratik R. Sampat <prsampat@amd.com>
>>> Signed-off-by: Pratik R. Sampat <prsampat@amd.com>
>>> Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
>>> ---
>>> arch/x86/kvm/svm/sev.c | 43 +++++++++++++++++++++++++++++++++---------
>>> 1 file changed, 34 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
>>> index ada53f04158c..a6abdb26f877 100644
>>> --- a/arch/x86/kvm/svm/sev.c
>>> +++ b/arch/x86/kvm/svm/sev.c
>>> @@ -2934,6 +2934,32 @@ void __init sev_set_cpu_caps(void)
>>> }
>>> }
>>>
>>> +static bool sev_is_snp_initialized(void)
>>
>> s/sev_is_snp_initialized/is_sev_snp_initalized looks better.
>>
>
> Actually the convention is sev_is_xx().
Except that it is a static, so doesn't need to start with sev_. See
is_pfn_range_shared(), max_level_for_order(), etc. in the same file.
Thanks,
Tom
>
>>> +{
prev parent reply other threads:[~2025-05-09 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 22:52 [PATCH] KVM: SEV: Disable SEV-SNP support on initialization failure Ashish Kalra
2025-05-09 14:04 ` Tom Lendacky
2025-05-09 17:01 ` Paluri, PavanKumar
2025-05-09 17:52 ` Kalra, Ashish
2025-05-09 17:57 ` Tom Lendacky [this message]
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=2d6b64ae-eca7-ae1d-1695-4c2697a60616@amd.com \
--to=thomas.lendacky@amd.com \
--cc=ashish.kalra@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=pankaj.gupta@amd.com \
--cc=papaluri@amd.com \
--cc=pavankumar.paluri@amd.com \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=prsampat@amd.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=sraithal@amd.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