diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-07 10:14:18 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-11-08 05:05:43 -0500 |
commit | 56ba47ddbd5af7918bf1acdbe3deb979d0dcd64b (patch) | |
tree | 791ae295a0cb48c82aa66ad3aaf0485cf5853185 /drivers/kvm | |
parent | 70433389ccfe2719ef5cd539d04172260294f0f5 (diff) |
KVM: SVM: Defer nmi processing until switch to host state is complete
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>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/svm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 3910358db79d..7376805c88ab 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -1585,10 +1585,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1585 | #endif | 1585 | #endif |
1586 | : "cc", "memory" ); | 1586 | : "cc", "memory" ); |
1587 | 1587 | ||
1588 | local_irq_disable(); | ||
1589 | |||
1590 | stgi(); | ||
1591 | |||
1592 | if ((svm->vmcb->save.dr7 & 0xff)) | 1588 | if ((svm->vmcb->save.dr7 & 0xff)) |
1593 | load_db_regs(svm->host_db_regs); | 1589 | load_db_regs(svm->host_db_regs); |
1594 | 1590 | ||
@@ -1605,6 +1601,10 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1605 | 1601 | ||
1606 | reload_tss(vcpu); | 1602 | reload_tss(vcpu); |
1607 | 1603 | ||
1604 | local_irq_disable(); | ||
1605 | |||
1606 | stgi(); | ||
1607 | |||
1608 | svm->next_rip = 0; | 1608 | svm->next_rip = 0; |
1609 | } | 1609 | } |
1610 | 1610 | ||