diff mbox

Check valid bit of VM_EXIT_INTR_INFO

Message ID 9832F13BD22FB94A829F798DA4A8280501A3ED7CB7@pdsmsx503.ccr.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dong, Eddie April 2, 2009, 2:37 a.m. UTC
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>

Comments

Avi Kivity April 2, 2009, 8:59 a.m. UTC | #1
Dong, Eddie wrote:
> Thx, eddie
>
>   

This code just got rewritten by Gleb.  Please check again after I push.
Gleb Natapov April 2, 2009, 9:04 a.m. UTC | #2
On Thu, Apr 02, 2009 at 11:59:35AM +0300, Avi Kivity wrote:
> Dong, Eddie wrote:
>> Thx, eddie
>>
>>   
>
> This code just got rewritten by Gleb.  Please check again after I push.
>
My patch adds the check.

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

Patch

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));