aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-07 17:14:18 +0200
committerAvi Kivity <avi@qumranet.com>2007-11-07 17:14:18 +0200
commitf3cb18371632dd89d4158319baaa4137cb0f1bbd (patch)
tree1eeeba2b1f2a1c048aca8fa8c911bf8030ff3998
parent94ef4576bb78d429e4f25cdc09e348434c76c1a3 (diff)
KVM: SVM: Defer nmi processing until switch to host state is completekvm-51
If we stgi() too soon, nmis can reach the processor even though interrupts are disabled, catching it in a half-switched state. Delay the stgi() until we're done switching. Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--drivers/kvm/svm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index ea2cb8366f70..f54b2ea64b92 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1570,10 +1570,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
#endif
);
- local_irq_disable();
-
- stgi();
-
if ((svm->vmcb->save.dr7 & 0xff))
load_db_regs(svm->host_db_regs);
@@ -1590,6 +1586,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
reload_tss(vcpu);
+ local_irq_disable();
+
+ stgi();
+
svm->next_rip = 0;
}