From: Avi Kivity Date: Mon, 7 Mar 2011 15:20:29 +0000 (+0200) Subject: KVM: VMX: Qualify check for host NMI X-Git-Tag: v3.0~722^2~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9902069c41254ad116e089e64ea21d3a000cc41;p=platform%2Fkernel%2Flinux-amlogic.git KVM: VMX: Qualify check for host NMI Check for the exit reason first; this allows us, later, to avoid a VMREAD for VM_EXIT_INTR_INFO_FIELD. Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 53bf6ae..89130ba 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3905,7 +3905,8 @@ static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx) kvm_machine_check(); /* We need to handle NMIs before interrupts are enabled */ - if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR && + if (vmx->exit_reason == EXIT_REASON_EXCEPTION_NMI && + (exit_intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR && (exit_intr_info & INTR_INFO_VALID_MASK)) { kvm_before_handle_nmi(&vmx->vcpu); asm("int $2");