public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] SVM: do not generate "external interrupt exit" if other exit is pending
@ 2010-09-20  8:15 Gleb Natapov
  2010-09-20  8:51 ` Roedel, Joerg
  2010-09-20 19:06 ` Marcelo Tosatti
  0 siblings, 2 replies; 3+ messages in thread
From: Gleb Natapov @ 2010-09-20  8:15 UTC (permalink / raw)
  To: kvm, avi, mtosatti; +Cc: joerg.roedel, agraf

Nested SVM checks for external interrupt after injecting nested exception.
In case there is external interrupt pending the code generates "external
interrupt exit" and overwrites previous exit info. If previously injected
exception already generated exit it will be lost.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 v1->v2
  - Added comment

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 43f5558..ca778d5 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1707,6 +1707,14 @@ static inline bool nested_svm_intr(struct vcpu_svm *svm)
 	if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
 		return false;
 
+	/*
+	 * if vmexit was already requested (by intercepted exception
+	 * for instance) do not overwrite it with "external interrupt"
+	 * vmexit.
+	 */
+	if (svm->nested.exit_required)
+		return false;
+
 	svm->vmcb->control.exit_code   = SVM_EXIT_INTR;
 	svm->vmcb->control.exit_info_1 = 0;
 	svm->vmcb->control.exit_info_2 = 0;
--
			Gleb.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-20 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20  8:15 [PATCHv2] SVM: do not generate "external interrupt exit" if other exit is pending Gleb Natapov
2010-09-20  8:51 ` Roedel, Joerg
2010-09-20 19:06 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox