Skip to content

Commit a1176ef

Browse files
committed
KVM: x86/mmu: Restrict KVM_SW_PROTECTED_VM to the TDP MMU
Advertise and support software-protected VMs if and only if the TDP MMU is enabled, i.e. disallow KVM_SW_PROTECTED_VM if TDP is enabled for KVM's legacy/shadow MMU. TDP support for the shadow MMU is maintenance-only, e.g. support for TDX and SNP will also be restricted to the TDP MMU. Fixes: 89ea60c ("KVM: x86: Add support for "protected VMs" that can utilize private memory") Link: https://lore.kernel.org/r/20240222190612.2942589-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 4226920 commit a1176ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4580,7 +4580,7 @@ static bool kvm_is_vm_type_supported(unsigned long type)
45804580
{
45814581
return type == KVM_X86_DEFAULT_VM ||
45824582
(type == KVM_X86_SW_PROTECTED_VM &&
4583-
IS_ENABLED(CONFIG_KVM_SW_PROTECTED_VM) && tdp_enabled);
4583+
IS_ENABLED(CONFIG_KVM_SW_PROTECTED_VM) && tdp_mmu_enabled);
45844584
}
45854585

45864586
int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)

0 commit comments

Comments
 (0)