]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
KVM: VMX: blocked-by-sti must not defer NMI injections
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 11 May 2010 13:16:46 +0000 (15:16 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 13 May 2010 04:31:37 +0000 (01:31 -0300)
As the processor may not consider GUEST_INTR_STATE_STI as a reason for
blocking NMI, it could return immediately with EXIT_REASON_NMI_WINDOW
when we asked for it. But as we consider this state as NMI-blocking, we
can run into an endless loop.

Resolve this by allowing NMI injection if just GUEST_INTR_STATE_STI is
active (originally suggested by Gleb). Intel confirmed that this is
safe, the processor will never complain about NMI injection in this
state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
KVM-Stable-Tag
Acked-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c

index bc933cfb4e66d7fff8af14a8a4d8beac2ce6fed3..2f8db0ec8ae4ae2f346f35d1cc670571b79b1f1f 100644 (file)
@@ -2703,8 +2703,7 @@ static int vmx_nmi_allowed(struct kvm_vcpu *vcpu)
                return 0;
 
        return  !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
-                       (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS |
-                               GUEST_INTR_STATE_NMI));
+                       (GUEST_INTR_STATE_MOV_SS | GUEST_INTR_STATE_NMI));
 }
 
 static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu)