Index: trunk/src/VBox/VMM/VMMAll/PDMAllIommu.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PDMAllIommu.cpp	(revision 87489)
+++ trunk/src/VBox/VMM/VMMAll/PDMAllIommu.cpp	(revision 87494)
@@ -63,4 +63,24 @@
 #endif
     return PCIBDF_MAKE(pBus->iBus, pPciDev->uDevFn);
+}
+
+
+/** @copydoc PDMIOMMUREGR3::pfnMsiRemap */
+int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut)
+{
+    PPDMIOMMU  pIommu       = PDMDEVINS_TO_IOMMU(pDevIns);
+    PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
+    if (   pDevInsIommu
+        && pDevInsIommu != pDevIns)
+    {
+        int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDeviceId, pMsiIn, pMsiOut);
+        if (RT_FAILURE(rc))
+        {
+            LogFunc(("MSI remap failed. uDeviceId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n", uDeviceId, pMsiIn->Addr.u64,
+                     pMsiIn->Data.u32, rc));
+        }
+        return rc;
+    }
+    return VERR_IOMMU_NOT_PRESENT;
 }
 
@@ -178,4 +198,5 @@
 
 
+#ifdef IN_RING3
 /**
  * Requests the mapping of a guest page into ring-3 in preparation for a bus master
@@ -196,8 +217,7 @@
  *                      pfnPhysReleasePageMappingLock needs.
  */
-int pdmIommuMemAccessReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv,
-                               PPGMPAGEMAPLOCK pLock)
-{
-#if defined(IN_RING3)
+int pdmR3IommuMemAccessReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv,
+                                 PPGMPAGEMAPLOCK pLock)
+{
     PPDMIOMMU  pIommu       = PDMDEVINS_TO_IOMMU(pDevIns);
     PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
@@ -221,8 +241,4 @@
     }
     return VERR_IOMMU_NOT_PRESENT;
-#else
-    RT_NOREF6(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);
-    return VERR_NOT_IMPLEMENTED;
-#endif
 }
 
@@ -246,8 +262,7 @@
  *                      pfnPhysReleasePageMappingLock needs.
  */
-int pdmIommuMemAccessWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv,
-                                PPGMPAGEMAPLOCK pLock)
-{
-#if defined(IN_RING3)
+int pdmR3IommuMemAccessWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv,
+                                  PPGMPAGEMAPLOCK pLock)
+{
     PPDMIOMMU  pIommu       = PDMDEVINS_TO_IOMMU(pDevIns);
     PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
@@ -271,8 +286,4 @@
     }
     return VERR_IOMMU_NOT_PRESENT;
-#else
-    RT_NOREF6(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);
-    return VERR_NOT_IMPLEMENTED;
-#endif
 }
 
@@ -299,8 +310,7 @@
  *                              in length).
  */
-int pdmIommuMemAccessBulkReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages,
-                                   uint32_t fFlags, const void **papvPages, PPGMPAGEMAPLOCK paLocks)
-{
-#ifdef IN_RING3
+int pdmR3IommuMemAccessBulkReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages,
+                                     uint32_t fFlags, const void **papvPages, PPGMPAGEMAPLOCK paLocks)
+{
     PPDMIOMMU  pIommu       = PDMDEVINS_TO_IOMMU(pDevIns);
     PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
@@ -339,8 +349,4 @@
     }
     return VERR_IOMMU_NOT_PRESENT;
-#else
-    RT_NOREF7(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);
-    return VERR_NOT_IMPLEMENTED;
-#endif
 }
 
@@ -367,8 +373,7 @@
  *                              in length).
  */
-int pdmIommuMemAccessBulkWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages,
-                                    uint32_t fFlags, void **papvPages, PPGMPAGEMAPLOCK paLocks)
-{
-#ifdef IN_RING3
+int pdmR3IommuMemAccessBulkWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages,
+                                      uint32_t fFlags, void **papvPages, PPGMPAGEMAPLOCK paLocks)
+{
     PPDMIOMMU  pIommu       = PDMDEVINS_TO_IOMMU(pDevIns);
     PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
@@ -407,28 +412,5 @@
     }
     return VERR_IOMMU_NOT_PRESENT;
-#else
-    RT_NOREF7(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);
-    return VERR_NOT_IMPLEMENTED;
-#endif
-}
-
-
-/** @copydoc PDMIOMMUREGR3::pfnMsiRemap */
-int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut)
-{
-    PPDMIOMMU  pIommu       = PDMDEVINS_TO_IOMMU(pDevIns);
-    PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns);
-    if (   pDevInsIommu
-        && pDevInsIommu != pDevIns)
-    {
-        int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDeviceId, pMsiIn, pMsiOut);
-        if (RT_FAILURE(rc))
-        {
-            LogFunc(("MSI remap failed. uDeviceId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n", uDeviceId, pMsiIn->Addr.u64,
-                     pMsiIn->Data.u32, rc));
-        }
-        return rc;
-    }
-    return VERR_IOMMU_NOT_PRESENT;
-}
-
+}
+#endif /* IN_RING3 */
+
