kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dong, Eddie" <eddie.dong@intel.com>
To: Avi Kivity <avi@redhat.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	"Mallick, Asit K" <asit.k.mallick@intel.com>,
	"Dong, Eddie" <eddie.dong@intel.com>
Subject: Check valid bit of VM_EXIT_INTR_INFO
Date: Thu, 2 Apr 2009 10:37:22 +0800	[thread overview]
Message-ID: <9832F13BD22FB94A829F798DA4A8280501A3ED7CB7@pdsmsx503.ccr.corp.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

Thx, eddie



commit ad4a9829c8d5b30995f008e32774bd5f555b7e9f
Author: root <root@eddie-wb.localdomain>
Date:   Thu Apr 2 11:16:03 2009 +0800

    Check valid bit of VM_EXIT_INTR_INFO before unblock nmi.
    
    Signed-off-by: Eddie Dong <Eddie.Dong@intel.com>

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index aba41ae..689523a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3268,16 +3268,18 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
 
 	exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
 	if (cpu_has_virtual_nmis()) {
-		unblock_nmi = (exit_intr_info & INTR_INFO_UNBLOCK_NMI) != 0;
-		vector = exit_intr_info & INTR_INFO_VECTOR_MASK;
 		/*
 		 * SDM 3: 25.7.1.2
 		 * Re-set bit "block by NMI" before VM entry if vmexit caused by
 		 * a guest IRET fault.
 		 */
-		if (unblock_nmi && vector != DF_VECTOR)
-			vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
+		if (exit_intr_info & INTR_INFO_VALID_MASK) {
+			unblock_nmi = !!(exit_intr_info & INTR_INFO_UNBLOCK_NMI);
+			vector = exit_intr_info & INTR_INFO_VECTOR_MASK;
+			if (unblock_nmi && vector != DF_VECTOR)
+				vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
 				      GUEST_INTR_STATE_NMI);
+		}
 	} else if (unlikely(vmx->soft_vnmi_blocked))
 		vmx->vnmi_blocked_time +=
 			ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time));

[-- Attachment #2: nmi_valid.patch --]
[-- Type: application/octet-stream, Size: 1311 bytes --]

commit ad4a9829c8d5b30995f008e32774bd5f555b7e9f
Author: root <root@eddie-wb.localdomain>
Date:   Thu Apr 2 11:16:03 2009 +0800

    Check valid bit of VM_EXIT_INTR_INFO before unblock nmi.
    
    Signed-off-by: Eddie Dong <Eddie.Dong@intel.com>

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index aba41ae..689523a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3268,16 +3268,18 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
 
 	exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
 	if (cpu_has_virtual_nmis()) {
-		unblock_nmi = (exit_intr_info & INTR_INFO_UNBLOCK_NMI) != 0;
-		vector = exit_intr_info & INTR_INFO_VECTOR_MASK;
 		/*
 		 * SDM 3: 25.7.1.2
 		 * Re-set bit "block by NMI" before VM entry if vmexit caused by
 		 * a guest IRET fault.
 		 */
-		if (unblock_nmi && vector != DF_VECTOR)
-			vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
+		if (exit_intr_info & INTR_INFO_VALID_MASK) {
+			unblock_nmi = !!(exit_intr_info & INTR_INFO_UNBLOCK_NMI);
+			vector = exit_intr_info & INTR_INFO_VECTOR_MASK;
+			if (unblock_nmi && vector != DF_VECTOR)
+				vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
 				      GUEST_INTR_STATE_NMI);
+		}
 	} else if (unlikely(vmx->soft_vnmi_blocked))
 		vmx->vnmi_blocked_time +=
 			ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time));

             reply	other threads:[~2009-04-02  2:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02  2:37 Dong, Eddie [this message]
2009-04-02  8:59 ` Check valid bit of VM_EXIT_INTR_INFO Avi Kivity
2009-04-02  9:04   ` Gleb Natapov

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=9832F13BD22FB94A829F798DA4A8280501A3ED7CB7@pdsmsx503.ccr.corp.intel.com \
    --to=eddie.dong@intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=avi@redhat.com \
    --cc=jun.nakajima@intel.com \
    --cc=kvm@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).