public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: x86: correct the misleading comment in vmx_handle_external_intr
@ 2016-10-10  0:23 Longpeng(Mike)
  2016-10-11 18:23 ` Radim Krčmář
  0 siblings, 1 reply; 4+ messages in thread
From: Longpeng(Mike) @ 2016-10-10  0:23 UTC (permalink / raw)
  To: pbonzini, rkrcmar, tglx, mingo, hpa, x86
  Cc: kvm, linux-kernel, zhaoshenglong, richard.weiyang, Longpeng(Mike)

Since Paolo has removed irq-enable-operation in vmx_handle_external_intr
(KVM: x86: use guest_exit_irqoff), the original comment about the IF bit
in rflags is incorrect now.

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
---
 arch/x86/kvm/vmx.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cf1b16d..9fa3c76 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -8647,9 +8647,12 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu)
 	register void *__sp asm(_ASM_SP);
 
 	/*
-	 * If external interrupt exists, IF bit is set in rflags/eflags on the
-	 * interrupt stack frame, and interrupt will be enabled on a return
-	 * from interrupt handler.
+	 * If external interrupt exists, fakes an interrupt stack and jump to
+	 * idt table to let real handler to handle it. Because most of bits in
+	 * rflags are cleared when VM exit(Intel SDM volum 3, chapter 27.5.3),
+	 * the IF bit is 0 in rflags on the interrupt stack frame, so interrupt
+	 * is still disabled when return from the irq handler, but it will be
+	 * enabled later by the caller.
 	 */
 	if ((exit_intr_info & (INTR_INFO_VALID_MASK | INTR_INFO_INTR_TYPE_MASK))
 			== (INTR_INFO_VALID_MASK | INTR_TYPE_EXT_INTR)) {
-- 
2.7.4

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

end of thread, other threads:[~2016-10-12 14:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-10  0:23 [PATCH] kvm: x86: correct the misleading comment in vmx_handle_external_intr Longpeng(Mike)
2016-10-11 18:23 ` Radim Krčmář
2016-10-12  1:15   ` Longpeng (Mike)
2016-10-12 14:05     ` Radim Krčmář

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