Index: /trunk/include/VBox/rawpci.h
===================================================================
--- /trunk/include/VBox/rawpci.h	(revision 36716)
+++ /trunk/include/VBox/rawpci.h	(revision 36717)
@@ -338,8 +338,10 @@
  * Interrupt service routine callback.
  *
+ * @returns if interrupt was processed.
+ *
  * @param   pvContext       Opaque user data passed to the handler.
  * @param   iIrq            Interrupt number.
  */
-typedef DECLCALLBACK(void) FNRAWPCIISR(void *pvContext, int32_t iIrq);
+typedef DECLCALLBACK(bool) FNRAWPCIISR(void *pvContext, int32_t iIrq);
 typedef FNRAWPCIISR *PFNRAWPCIISR;
 
@@ -582,3 +584,5 @@
 RT_C_DECLS_END
 
+/* #define VBOX_WITH_SHARED_PCI_INTERRUPTS */
+
 #endif
Index: /trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c	(revision 36716)
+++ /trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c	(revision 36717)
@@ -74,15 +74,28 @@
     return NULL;
 }
-
-DECLINLINE(int) vboxPciDevLock(PVBOXRAWPCIINS pThis)
-{
+DECLINLINE(int) vboxPciDevLock(PVBOXRAWPCIINS pThis, 
+                               PRTSPINLOCKTMP pTmp)
+{
+#ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS
+    RTSpinlockAcquireNoInts(pThis->hSpinlock, pTmp);
+    return VINF_SUCCESS;
+#else    
     int rc = RTSemFastMutexRequest(pThis->hFastMtx);
+
+    NOREF(pTmp);
     AssertRC(rc);
     return rc;
-}
-
-DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis)
-{
+#endif
+}
+
+DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis,
+                                  PRTSPINLOCKTMP pTmp)
+{
+#ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS
+    RTSpinlockReleaseNoInts(pThis->hSpinlock, pTmp);
+#else
+    NOREF(pTmp);
     RTSemFastMutexRelease(pThis->hFastMtx);
+#endif
 }
 
@@ -171,10 +184,11 @@
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
     int rc;
-
-    vboxPciDevLock(pThis);
+    RTSPINLOCKTMP aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevInit(pThis, fFlags);
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -187,7 +201,8 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
-
-    vboxPciDevLock(pThis);
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     if (pThis->IrqHandler.pfnIrqHandler)
@@ -200,5 +215,5 @@
     rc = vboxPciOsDevDeinit(pThis, fFlags);
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -249,12 +264,13 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
-
-    vboxPciDevLock(pThis);
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevGetRegionInfo(pThis, iRegion,
                                    pRegionStart, pu64RegionSize,
                                    pfPresent, pfFlags);
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -272,11 +288,12 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
-
-    vboxPciDevLock(pThis);
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevMapRegion(pThis, iRegion, RegionStart, u64RegionSize, fFlags, pRegionBase);
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -293,11 +310,12 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
-
-    vboxPciDevLock(pThis);
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevUnmapRegion(pThis, iRegion, RegionStart, u64RegionSize, RegionBase);
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -312,12 +330,12 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-
-    int rc;
-
-    vboxPciDevLock(pThis);
+    RTSPINLOCKTMP  aTmp;
+    int            rc;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevPciCfgRead(pThis, Register, pValue);
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -332,11 +350,12 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
-
-    vboxPciDevLock(pThis);
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevPciCfgWrite(pThis, Register, pValue);
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -349,11 +368,12 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int     rc;
-    int32_t iHostIrq = 0;
+    int            rc;
+    int32_t        iHostIrq = 0;
+    RTSPINLOCKTMP  aTmp;
 
     if (pfnHandler == NULL)
         return VERR_INVALID_PARAMETER;
 
-    vboxPciDevLock(pThis);
+    vboxPciDevLock(pThis, &aTmp);
 
     if (pThis->IrqHandler.pfnIrqHandler)
@@ -373,5 +393,5 @@
     }
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -382,10 +402,11 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
 
     if (hIsr != 0xcafe0000)
         return VERR_INVALID_PARAMETER;
 
-    vboxPciDevLock(pThis);
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevUnregisterIrqHandler(pThis, pThis->IrqHandler.iHostIrq);
@@ -396,5 +417,5 @@
         pThis->IrqHandler.iHostIrq = 0;
     }
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
@@ -406,7 +427,8 @@
 {
     PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort);
-    int rc;
-
-    vboxPciDevLock(pThis);
+    int            rc;
+    RTSPINLOCKTMP  aTmp;
+
+    vboxPciDevLock(pThis, &aTmp);
 
     rc = vboxPciOsDevPowerStateChange(pThis, aState);
@@ -426,5 +448,5 @@
 
 
-    vboxPciDevUnlock(pThis);
+    vboxPciDevUnlock(pThis, &aTmp);
 
     return rc;
