All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: set "blocked by NMI" flag if EPT violation happens during IRET from NMI
@ 2013-09-15  8:07 Gleb Natapov
  0 siblings, 0 replies; only message in thread
From: Gleb Natapov @ 2013-09-15  8:07 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini

Set "blocked by NMI" flag if EPT violation happens during IRET from NMI
otherwise NMI can be called recursively causing stack corruption.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 1f1da43..fa1984c 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5339,6 +5339,15 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
 		return 0;
 	}
 
+	/*
+	 * EPT violation happened while executing iret from NMI,
+	 * "blocked by NMI" bit has to be set before next VM entry.
+	 * There are errata that may cause this bit to not be set:
+	 * AAK134, BY25. 
+	 */
+	if (exit_qualification & INTR_INFO_UNBLOCK_NMI)
+		vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI);
+
 	gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
 	trace_kvm_page_fault(gpa, exit_qualification);
 
--
			Gleb.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-15  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15  8:07 [PATCH] KVM: VMX: set "blocked by NMI" flag if EPT violation happens during IRET from NMI Gleb Natapov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.