Index: /trunk/include/VBox/pdmdev.h
===================================================================
--- /trunk/include/VBox/pdmdev.h	(revision 20834)
+++ /trunk/include/VBox/pdmdev.h	(revision 20835)
@@ -1103,4 +1103,21 @@
 } PDMAPICVERSION;
 
+/**
+ * APIC irq argument for SetInterruptFF.
+ */
+typedef enum PDMAPICIRQ
+{
+    /** Invalid 0 entry. */
+    PDMAPICIRQ_INVALID = 0,
+    /** Normal hardware interrupt. */
+    PDMAPICIRQ_HARDWARE,
+    /** NMI. */
+    PDMAPICIRQ_NMI,
+    /** SMI. */
+    PDMAPICIRQ_SMI,
+    /** The usual 32-bit paranoia. */
+    PDMAPICIRQ_32BIT_HACK = 0x7fffffff
+} PDMAPICIRQ;
+
 
 /**
@@ -1116,7 +1133,8 @@
      *
      * @param   pDevIns         Device instance of the APIC.
+     * @param   enmType         Irq type
      * @param   idCpu           Virtual CPU to set flag upon.
      */
-    DECLRCCALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, VMCPUID idCpu));
+    DECLRCCALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu));
 
     /**
@@ -1169,5 +1187,5 @@
 
 /** Current PDMAPICHLPRC version number. */
-#define PDM_APICHLPRC_VERSION   0x60010000
+#define PDM_APICHLPRC_VERSION   0x60010001
 
 
@@ -1184,7 +1202,8 @@
      *
      * @param   pDevIns         Device instance of the APIC.
+     * @param   enmType         Irq type
      * @param   idCpu           Virtual CPU to set flag upon.
      */
-    DECLR0CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, VMCPUID idCpu));
+    DECLR0CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu));
 
     /**
@@ -1237,5 +1256,5 @@
 
 /** Current PDMAPICHLPR0 version number. */
-#define PDM_APICHLPR0_VERSION   0x60010000
+#define PDM_APICHLPR0_VERSION   0x60010001
 
 /**
@@ -1251,7 +1270,8 @@
      *
      * @param   pDevIns         Device instance of the APIC.
+     * @param   enmType         IRQ type
      * @param   idCpu           Virtual CPU to set flag upon.
      */
-    DECLR3CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, VMCPUID idCpu));
+    DECLR3CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu));
 
     /**
@@ -1351,5 +1371,5 @@
 
 /** Current PDMAPICHLP version number. */
-#define PDM_APICHLPR3_VERSION  0xfd020000
+#define PDM_APICHLPR3_VERSION  0xfd020001
 
 
Index: /trunk/include/VBox/vm.h
===================================================================
--- /trunk/include/VBox/vm.h	(revision 20834)
+++ /trunk/include/VBox/vm.h	(revision 20835)
@@ -294,11 +294,15 @@
 
 
-/** This action forces the VM to service check and pending interrups on the APIC. */
+/** This action forces the VM to check any pending interrups on the APIC. */
 #define VMCPU_FF_INTERRUPT_APIC             RT_BIT_32(0)
-/** This action forces the VM to service check and pending interrups on the PIC. */
+/** This action forces the VM to check any pending interrups on the PIC. */
 #define VMCPU_FF_INTERRUPT_PIC              RT_BIT_32(1)
 /** This action forces the VM to schedule and run pending timer (TM).
  * @remarks Don't move - PATM compatability.  */
 #define VMCPU_FF_TIMER                      RT_BIT_32(2)
+/** This action forces the VM to check any pending NMIs. */
+#define VMCPU_FF_INTERRUPT_NMI              RT_BIT_32(3)
+/** This action forces the VM to check any pending SMIs. */
+#define VMCPU_FF_INTERRUPT_SMI              RT_BIT_32(4)
 /** PDM critical section unlocking is pending, process promptly upon return to R3. */
 #define VMCPU_FF_PDM_CRITSECT               RT_BIT_32(5)
Index: /trunk/include/iprt/log.h
===================================================================
--- /trunk/include/iprt/log.h	(revision 20834)
+++ /trunk/include/iprt/log.h	(revision 20835)
@@ -323,4 +323,6 @@
     /** New lines should be prefixed with thread name. */
     RTLOGFLAGS_PREFIX_THREAD        = 0x00800000,
+    /** New lines should be prefixed with the VCPU id. */
+    RTLOGFLAGS_PREFIX_VCPU          = 0x01000000,
     /** New lines should be prefixed with formatted timestamp since program start. */
     RTLOGFLAGS_PREFIX_TIME_PROG     = 0x04000000,
Index: /trunk/src/VBox/VMM/PDMDevMiscHlp.cpp
===================================================================
--- /trunk/src/VBox/VMM/PDMDevMiscHlp.cpp	(revision 20834)
+++ /trunk/src/VBox/VMM/PDMDevMiscHlp.cpp	(revision 20835)
@@ -145,5 +145,5 @@
 
 /** @copydoc PDMAPICHLPR3::pfnSetInterruptFF */
-static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu)
+static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu)
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
@@ -156,5 +156,16 @@
              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, idCpu, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INTERRUPT_APIC)));
 
-    VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC);
+    switch (enmType)
+    {
+    case PDMAPICIRQ_HARDWARE:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC);
+        break;
+    case PDMAPICIRQ_NMI:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI);
+        break;
+    case PDMAPICIRQ_SMI:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_SMI);
+        break;
+    }
     REMR3NotifyInterruptSet(pVM, pVCpu);
     VMR3NotifyCpuFFU(pVCpu->pUVCpu, VMNOTIFYFF_FLAGS_DONE_REM | VMNOTIFYFF_FLAGS_POKE);
Index: /trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp	(revision 20834)
+++ /trunk/src/VBox/VMM/VMMGC/PDMGCDevice.cpp	(revision 20835)
@@ -86,5 +86,5 @@
  * @{
  */
-static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
+static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu);
 static DECLCALLBACK(void) pdmRCApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
 static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
@@ -412,5 +412,5 @@
 
 /** @copydoc PDMAPICHLPRC::pfnSetInterruptFF */
-static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu)
+static DECLCALLBACK(void) pdmRCApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu)
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
@@ -422,5 +422,16 @@
     LogFlow(("pdmRCApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
              pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INTERRUPT_APIC)));
-    VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC);
+    switch (enmType)
+    {
+    case PDMAPICIRQ_HARDWARE:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC);
+        break;
+    case PDMAPICIRQ_NMI:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI);
+        break;
+    case PDMAPICIRQ_SMI:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_SMI);
+        break;
+    }
 }
 
Index: /trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp	(revision 20834)
+++ /trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp	(revision 20835)
@@ -89,5 +89,5 @@
  * @{
  */
-static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
+static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu);
 static DECLCALLBACK(void) pdmR0ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu);
 static DECLCALLBACK(void) pdmR0ApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion);
@@ -427,5 +427,5 @@
 
 /** @copydoc PDMAPICHLPR0::pfnSetInterruptFF */
-static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, VMCPUID idCpu)
+static DECLCALLBACK(void) pdmR0ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu)
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
@@ -437,5 +437,17 @@
     LogFlow(("pdmR0ApicHlp_SetInterruptFF: caller=%p/%d: VM_FF_INTERRUPT %d -> 1\n",
              pDevIns, pDevIns->iInstance, VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INTERRUPT_APIC)));
-    VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC);
+
+    switch (enmType)
+    {
+    case PDMAPICIRQ_HARDWARE:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC);
+        break;
+    case PDMAPICIRQ_NMI:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_NMI);
+        break;
+    case PDMAPICIRQ_SMI:
+        VMCPU_FF_SET(pVCpu, VMCPU_FF_INTERRUPT_SMI);
+        break;
+    }
 
     /* We need to wait up the target CPU. */
