Skip to content

Commit 79264ff

Browse files
yamahatabonzini
authored andcommitted
KVM: TDX: Ignore setting up mce
Because vmx_set_mce function is VMX specific and it cannot be used for TDX. Add vt stub to ignore setting up mce for TDX. Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com> Message-ID: <20250227012021.1778144-17-binbin.wu@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent cf5f366 commit 79264ff

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/x86/kvm/vmx/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,14 @@ static void vt_cancel_hv_timer(struct kvm_vcpu *vcpu)
843843
}
844844
#endif
845845

846+
static void vt_setup_mce(struct kvm_vcpu *vcpu)
847+
{
848+
if (is_td_vcpu(vcpu))
849+
return;
850+
851+
vmx_setup_mce(vcpu);
852+
}
853+
846854
static int vt_mem_enc_ioctl(struct kvm *kvm, void __user *argp)
847855
{
848856
if (!is_td(kvm))
@@ -1002,7 +1010,7 @@ struct kvm_x86_ops vt_x86_ops __initdata = {
10021010
.cancel_hv_timer = vt_cancel_hv_timer,
10031011
#endif
10041012

1005-
.setup_mce = vmx_setup_mce,
1013+
.setup_mce = vt_setup_mce,
10061014

10071015
#ifdef CONFIG_KVM_SMM
10081016
.smi_allowed = vt_smi_allowed,

0 commit comments

Comments
 (0)