On Mon, Apr 13, 2009 at 12:55:43PM +0300, [email protected] wrote:
> 
> Signed-off-by: Gleb Natapov <[email protected]>

The attached patch if applied on the top of the serie fixes the NMI issue on
SVM. I did not refactor it on the top of this patch though, sorry.

-- 
With best wishes
Dmitry

>From 26d7e88c84089abbe871286d54e77ff2922dc33d Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <[email protected]>
Date: Fri, 17 Apr 2009 22:53:50 +0400
Subject: [PATCH] KVM: correct NMI injection logic wrt NMI window tracking

inject_pending_irq() calls inject_irq() which disables nmi_pending flag
if the nmi was injected. Thus for tracking we should use nmi_injected
flag. This al fin fixes NMI injection on SVM.

Signed-off-by: Dmitry Eremin-Solenikov <[email protected]>
---
 arch/x86/kvm/x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e4cc717..eeed350 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3160,7 +3160,7 @@ static void inject_pending_irq(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 	inject_irq(vcpu);
 
 	/* enable NMI/IRQ window open exits if needed */
-	if (vcpu->arch.nmi_pending)
+	if (vcpu->arch.nmi_injected)
 		kvm_x86_ops->enable_nmi_window(vcpu);
 	else if (kvm_cpu_has_interrupt(vcpu) || req_int_win)
 		kvm_x86_ops->enable_irq_window(vcpu);
-- 
1.6.2.1

Reply via email to