mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Longpeng(Mike)" <longpeng2@huawei.com>
To: <pbonzini@redhat.com>, <rkrcmar@redhat.com>, <tglx@linutronix.de>,
	<mingo@redhat.com>, <hpa@zytor.com>, <x86@kernel.org>
Cc: <kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<zhaoshenglong@huawei.com>, <richard.weiyang@huawei.com>,
	"Longpeng(Mike)" <longpeng2@huawei.com>
Subject: [PATCH] kvm: x86: correct the misleading comment in vmx_handle_external_intr
Date: Mon, 10 Oct 2016 08:23:43 +0800	[thread overview]
Message-ID: <1476059023-33224-1-git-send-email-longpeng2@huawei.com> (raw)

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

             reply	other threads:[~2016-10-10  0:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  0:23 Longpeng(Mike) [this message]
2016-10-11 18:23 ` Radim Krčmář
2016-10-12  1:15   ` Longpeng (Mike)
2016-10-12 14:05     ` Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476059023-33224-1-git-send-email-longpeng2@huawei.com \
    --to=longpeng2@huawei.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=richard.weiyang@huawei.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zhaoshenglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®