]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SEV: Don't advertise support for unusable VM types
authorSean Christopherson <seanjc@google.com>
Thu, 16 Apr 2026 23:23:27 +0000 (16:23 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 13 May 2026 16:55:54 +0000 (09:55 -0700)
commit93d1a486e1d4f05db65b36db5fe2bca3d0257bb0
treeede405416b34f4597c05a2be8e40ea2c8f7baa00
parent82bf8282444c03a8a61b718b3ba3582b0481e970
KVM: SEV: Don't advertise support for unusable VM types

Commit 0aa6b90ef9d7 ("KVM: SVM: Add support for allowing zero SEV ASIDs")
made it possible to make it impossible to use SEV VMs by not allocating
them any ASIDs.

Commit 6c7c620585c6 ("KVM: SEV: Add SEV-SNP CipherTextHiding support") did
the same thing for SEV-ES.

Do not export KVM_X86_SEV(_ES)_VM as supported types if in either of these
situations, so that userspace can use them to determine what is actually
supported by the current kernel configuration.

Also move the buildup to a local variable so it is easier to add additional
masking in future patches.

Link: https://lore.kernel.org/all/aZyLIWtffvEnmtYh@google.com/
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Tycho Andersen (AMD) <tycho@kernel.org>
[sean: land code in sev_hardware_setup()]
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Tycho Andersen (AMD) <tycho@kernel.org>
Link: https://patch.msgid.link/20260416232329.3408497-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c