KVM: SEV: Disable SEV-SNP support on initialization failure
authorAshish Kalra <ashish.kalra@amd.com>
Mon, 12 May 2025 22:16:34 +0000 (22:16 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Jun 2025 18:27:06 +0000 (14:27 -0400)
commit179a8427fcbffe36ccfed5e138d7c9b6180caff9
tree82e82978e5960df27c905bb6bdb0e5703cfd9b14
parentce360c2bfd219130bf1df4282ccf2e9bdf3a5ed5
KVM: SEV: Disable SEV-SNP support on initialization failure

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>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Reviewed-by: Pavan Kumar Paluri <papaluri@amd.com>
Message-ID: <20250512221634.12045-1-Ashish.Kalra@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c