diff options
author | Avi Kivity <avi@redhat.com> | 2011-03-07 10:20:29 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:56:56 -0400 |
commit | f9902069c41254ad116e089e64ea21d3a000cc41 (patch) | |
tree | 3d7a8ab867642433d77fea4c0326398083d43bde /arch | |
parent | 9d58b93192065f4b2ba6b880e9b0dab0bc11d0ba (diff) |
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 <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 53bf6ae493e3..89130ba3b698 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) | |||
3905 | kvm_machine_check(); | 3905 | kvm_machine_check(); |
3906 | 3906 | ||
3907 | /* We need to handle NMIs before interrupts are enabled */ | 3907 | /* We need to handle NMIs before interrupts are enabled */ |
3908 | if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR && | 3908 | if (vmx->exit_reason == EXIT_REASON_EXCEPTION_NMI && |
3909 | (exit_intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR && | ||
3909 | (exit_intr_info & INTR_INFO_VALID_MASK)) { | 3910 | (exit_intr_info & INTR_INFO_VALID_MASK)) { |
3910 | kvm_before_handle_nmi(&vmx->vcpu); | 3911 | kvm_before_handle_nmi(&vmx->vcpu); |
3911 | asm("int $2"); | 3912 | asm("int $2"); |