[PATCH 3/5] Don't #VMEXIT(INTR) if we still have event_inj waiting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Real hardware would first process the event_inj field and then notify the
host that an interrupt is waiting.

Let's do the same and just not EXIT_INTR if we have an event pending for the
L2 guest.

Signed-off-by: Alexander Graf <agraf@xxxxxxx>
---
 arch/x86/kvm/svm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 61efd13..28fcbd0 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1401,6 +1401,10 @@ static inline int nested_svm_intr(struct vcpu_svm *svm)
 	if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
 		return 0;
 
+	/* We can't EXIT_INTR when we still have an event to inject */
+	if (svm->vmcb->control.event_inj)
+		return 1;
+
 	svm->vmcb->control.exit_code = SVM_EXIT_INTR;
 
 	if (nested_svm_exit_handled(svm)) {
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux