[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6wANGkZb7_HK8ay@google.com>
Date: Tue, 11 Feb 2025 17:58:12 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: "Pratik R. Sampat" <prsampat@....com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, kvm@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-kselftest@...r.kernel.org,
pbonzini@...hat.com, thomas.lendacky@....com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, shuah@...nel.org,
pgonda@...gle.com, ashish.kalra@....com, nikunj@....com, pankaj.gupta@....com,
michael.roth@....com, sraithal@....com
Subject: Re: [PATCH v6 2/9] KVM: SEV: Disable SEV on platform init failure
On Mon, Feb 03, 2025, Pratik R. Sampat wrote:
> If the platform initialization sev_platform_init() fails, SEV cannot be
> set up and a secure VM cannot be spawned. Therefore, in this case,
> ensure that KVM does not set up, nor advertise support for SEV, SEV-ES,
> and SEV-SNP.
>
> Suggested-by: Nikunj A Dadhania <nikunj@....com>
> Tested-by: Srikanth Aithal <sraithal@....com>
> Signed-off-by: Pratik R. Sampat <prsampat@....com>
> ---
> v5..v6:
>
> * Rename is_sev_platform_init to sev_fw_initialized (Nikunj)
> * Collected tags from Srikanth.
> ---
> arch/x86/kvm/svm/sev.c | 2 +-
> drivers/crypto/ccp/sev-dev.c | 10 ++++++++++
> include/linux/psp-sev.h | 3 +++
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index b709c2f0945c..42d1309f8a54 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -2957,7 +2957,7 @@ void __init sev_hardware_setup(void)
> bool sev_es_supported = false;
> bool sev_supported = false;
>
> - if (!sev_enabled || !npt_enabled || !nrips)
> + if (!sev_fw_initialized() || !sev_enabled || !npt_enabled || !nrips)
> goto out;
Me thinks this wasn't tested with KVM_AMD built-in[1]. I'm pretty sure Ashish's
fix[2] solves all of this?
[1] https://lore.kernel.org/all/d6d08c6b-9602-4f3d-92c2-8db6d50a1b92@amd.com
[2] https://lore.kernel.org/all/f78ddb64087df27e7bcb1ae0ab53f55aa0804fab.1739226950.git.ashish.kalra@amd.com
Powered by blists - more mailing lists