[PATCH v2 19/20] KVM: TDX: Make TDX VM type supported

From: Binbin Wu
Date: Wed Feb 26 2025 - 20:24:42 EST


From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>

Now all the necessary code for TDX is in place, it's ready to run TDX
guest. Advertise the VM type of KVM_X86_TDX_VM so that the user space
VMM like QEMU can start to use it.

Signed-off-by: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
Signed-off-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
---
TDX "the rest" v2:
- No change.

TDX "the rest" v1:
- Move down to the end of patch series.
---
arch/x86/kvm/vmx/main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
index fa8b5f609666..320c96e1e80a 100644
--- a/arch/x86/kvm/vmx/main.c
+++ b/arch/x86/kvm/vmx/main.c
@@ -1092,6 +1092,7 @@ static int __init vt_init(void)
vcpu_align = max_t(unsigned, vcpu_align,
__alignof__(struct vcpu_tdx));
kvm_caps.supported_quirks &= ~KVM_X86_QUIRK_EPT_IGNORE_GUEST_PAT;
+ kvm_caps.supported_vm_types |= BIT(KVM_X86_TDX_VM);
}

/*
--
2.46.0