Author: tychon
Date: Mon Jun 16 22:59:18 2014
New Revision: 267558
URL: http://svnweb.freebsd.org/changeset/base/267558

Log:
  Bring an overly enthusiastic KASSERT inline with the Intel SDM.
  
  Reviewed by:  neel

Modified:
  head/sys/amd64/vmm/intel/vmx.c

Modified: head/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- head/sys/amd64/vmm/intel/vmx.c      Mon Jun 16 21:37:16 2014        
(r267557)
+++ head/sys/amd64/vmm/intel/vmx.c      Mon Jun 16 22:59:18 2014        
(r267558)
@@ -1258,12 +1258,28 @@ vmx_inject_interrupts(struct vmx *vmx, i
                /* Ask the local apic for a vector to inject */
                if (!vlapic_pending_intr(vlapic, &vector))
                        return;
+
+               /*
+                * From the Intel SDM, Volume 3, Section "Maskable
+                * Hardware Interrupts":
+                * - maskable interrupt vectors [16,255] can be delivered
+                *   through the local APIC.
+               */
+               KASSERT(vector >= 16 && vector <= 255,
+                   ("invalid vector %d from local APIC", vector));
        } else {
                /* Ask the legacy pic for a vector to inject */
                vatpic_pending_intr(vmx->vm, &vector);
-       }
 
-       KASSERT(vector >= 32 && vector <= 255, ("invalid vector %d", vector));
+               /*
+                * From the Intel SDM, Volume 3, Section "Maskable
+                * Hardware Interrupts":
+                * - maskable interrupt vectors [0,255] can be delivered
+                *   through the INTR pin.
+                */
+               KASSERT(vector >= 0 && vector <= 255,
+                   ("invalid vector %d from INTR", vector));
+       }
 
        /* Check RFLAGS.IF and the interruptibility state of the guest */
        rflags = vmcs_read(VMCS_GUEST_RFLAGS);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to