diff mbox

KVM: MCE: Fix compiling without CONFIG_X86_MCE

Message ID 1244511444.8361.605.camel@yhuang-dev.sh.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Huang, Ying June 9, 2009, 1:37 a.m. UTC
Enclose do_machine_check with #ifdef CONFIG_X86_MCE.

Reported-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>

---
 arch/x86/kvm/vmx.c |    2 ++
 1 file changed, 2 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Avi Kivity June 10, 2009, 9:08 a.m. UTC | #1
Huang Ying wrote:
> Enclose do_machine_check with #ifdef CONFIG_X86_MCE.
>
> Reported-by: Marcelo Tosatti <mtosatti@redhat.com>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
>   

Applied, thanks.

I would have preferred to select X86_MCE instead, but that doesn't do 
anything (need to select X86_MCE_INTEL as well, and that becomes fragile).
diff mbox

Patch

--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2623,12 +2623,14 @@  static int handle_rmode_exception(struct
  */
 static void kvm_machine_check(void)
 {
+#ifdef CONFIG_X86_MCE
 	struct pt_regs regs = {
 		.cs = 3, /* Fake ring 3 no matter what the guest ran on */
 		.flags = X86_EFLAGS_IF,
 	};
 
 	do_machine_check(&regs, 0);
+#endif
 }
 
 static int handle_machine_check(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)