]> xenbits.xensource.com Git - people/pauldu/linux.git/commit
KVM: SVM: Add support for allowing zero SEV ASIDs
authorAshish Kalra <ashish.kalra@amd.com>
Wed, 31 Jan 2024 23:56:08 +0000 (15:56 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 6 Feb 2024 19:10:11 +0000 (11:10 -0800)
commit0aa6b90ef9d75b4bd7b6d106d85f2a3437697f91
tree51aa5c4ce1b3b2d53a4f538e36c5c3402f6d629d
parent466eec4a22a76c462781bf6d45cb02cbedf21a61
KVM: SVM: Add support for allowing zero SEV ASIDs

Some BIOSes allow the end user to set the minimum SEV ASID value
(CPUID 0x8000001F_EDX) to be greater than the maximum number of
encrypted guests, or maximum SEV ASID value (CPUID 0x8000001F_ECX)
in order to dedicate all the SEV ASIDs to SEV-ES or SEV-SNP.

The SEV support, as coded, does not handle the case where the minimum
SEV ASID value can be greater than the maximum SEV ASID value.
As a result, the following confusing message is issued:

[   30.715724] kvm_amd: SEV enabled (ASIDs 1007 - 1006)

Fix the support to properly handle this case.

Fixes: 916391a2d1dc ("KVM: SVM: Add support for SEV-ES capability in KVM")
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Cc: stable@vger.kernel.org
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240104190520.62510-1-Ashish.Kalra@amd.com
Link: https://lore.kernel.org/r/20240131235609.4161407-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c