From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx> Signed-off-by: Isaku Yamahata <isaku.yamahata@xxxxxxxxx> --- include/sysemu/tdx.h | 1 + target/i386/kvm/kvm.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/sysemu/tdx.h b/include/sysemu/tdx.h index 70eb01348f..f3eced10f9 100644 --- a/include/sysemu/tdx.h +++ b/include/sysemu/tdx.h @@ -6,6 +6,7 @@ #include "hw/i386/pc.h" bool kvm_has_tdx(KVMState *s); +bool kvm_tdx_enabled(void); int tdx_system_firmware_init(PCMachineState *pcms, MemoryRegion *rom_memory); #endif diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index af6b5f350e..76c3ea9fac 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -152,6 +152,11 @@ int kvm_set_vm_type(MachineState *ms, int kvm_type) return -ENOTSUP; } +bool kvm_tdx_enabled(void) +{ + return vm_type == KVM_X86_TDX_VM; +} + int kvm_has_pit_state2(void) { return has_pit_state2; -- 2.25.1