Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56ba47dd authored by Avi Kivity's avatar Avi Kivity
Browse files

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: default avatarAvi Kivity <avi@qumranet.com>
parent 70433389
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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);

@@ -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;
}