Skip to content
Commit ab7a6fe9 authored by Ashish Kalra's avatar Ashish Kalra Committed by Greg Kroah-Hartman
Browse files

KVM: SVM: Add support for allowing zero SEV ASIDs

[ Upstream commit 0aa6b90e ]

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: 916391a2

 ("KVM: SVM: Add support for SEV-ES capability in KVM")
Suggested-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarAshish Kalra <ashish.kalra@amd.com>
Cc: stable@vger.kernel.org
Acked-by: default avatarTom 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: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 79b79ea2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment