[PATCH 1/1] KVM/TDX: Use lapic_in_kernel() in tdx_vcpu_create()
From: Tony Lindgren
Date: Mon Sep 02 2024 - 06:52:20 EST
Use lapic_in_kernel() in tdx_vcpu_create().
Suggested-by: Nikolay Borisov <nik.borisov@xxxxxxxx>
Signed-off-by: Tony Lindgren <tony.lindgren@xxxxxxxxxxxxxxx>
---
arch/x86/kvm/vmx/tdx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index d0dc3200fa37..b905a7c9e2ff 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -8,6 +8,7 @@
#include "capabilities.h"
#include "mmu.h"
#include "x86_ops.h"
+#include "lapic.h"
#include "tdx.h"
#include "vmx.h"
#include "mmu/spte.h"
@@ -674,7 +675,7 @@ int tdx_vcpu_create(struct kvm_vcpu *vcpu)
return -EIO;
/* TDX only supports x2APIC, which requires an in-kernel local APIC. */
- if (!vcpu->arch.apic)
+ if (!lapic_in_kernel(vcpu))
return -EINVAL;
fpstate_set_confidential(&vcpu->arch.guest_fpu);
--
2.47.1