Skip to content

Commit

Permalink
KVM: SVM: Defer nmi processing until switch to host state is complete
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avi Kivity committed Nov 8, 2007
1 parent 7043338 commit 56ba47d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1585,10 +1585,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
#endif
: "cc", "memory" );

local_irq_disable();

stgi();

if ((svm->vmcb->save.dr7 & 0xff))
load_db_regs(svm->host_db_regs);

Expand All @@ -1605,6 +1601,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;
}

Expand Down

0 comments on commit 56ba47d

Please sign in to comment.