Changeset 88078 in vbox
- Timestamp:
- Mar 10, 2021 7:25:11 PM (4 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r88075 r88078 1239 1239 * 1240 1240 * @param pThis The shared IOMMU device state. 1241 * @param pThis 1241 * @param pThisR3 The ring-3 IOMMU device state. 1242 1242 * @param idDomain The domain ID. 1243 1243 * @param uIova The I/O virtual address. -
trunk/src/VBox/VMM/VMMAll/PDMAllIommu.cpp
r88075 r88078 68 68 69 69 /** @copydoc PDMIOMMUREGR3::pfnMsiRemap */ 70 int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut)71 { 72 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 73 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); 74 if ( pDevInsIommu 75 && pDevInsIommu != pDevIns) 76 { 77 int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDeviceId, pMsiIn, pMsiOut);70 int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t idDevice, PCMSIMSG pMsiIn, PMSIMSG pMsiOut) 71 { 72 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 73 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); 74 if ( pDevInsIommu 75 && pDevInsIommu != pDevIns) 76 { 77 int rc = pIommu->pfnMsiRemap(pDevInsIommu, idDevice, pMsiIn, pMsiOut); 78 78 if (RT_FAILURE(rc)) 79 79 { 80 LogFunc(("MSI remap failed. uDeviceId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n", uDeviceId, pMsiIn->Addr.u64,80 LogFunc(("MSI remap failed. idDevice=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n", idDevice, pMsiIn->Addr.u64, 81 81 pMsiIn->Data.u32, rc)); 82 82 } … … 110 110 && pDevInsIommu != pDevIns) 111 111 { 112 uint16_t const uDeviceId= pdmIommuGetPciDeviceId(pDevIns, pPciDev);112 uint16_t const idDevice = pdmIommuGetPciDeviceId(pDevIns, pPciDev); 113 113 int rc = VINF_SUCCESS; 114 114 while (cbRead > 0) … … 116 116 RTGCPHYS GCPhysOut; 117 117 size_t cbContig; 118 rc = pIommu->pfnMemAccess(pDevInsIommu, uDeviceId, GCPhys, cbRead, PDMIOMMU_MEM_F_READ, &GCPhysOut, &cbContig);118 rc = pIommu->pfnMemAccess(pDevInsIommu, idDevice, GCPhys, cbRead, PDMIOMMU_MEM_F_READ, &GCPhysOut, &cbContig); 119 119 if (RT_SUCCESS(rc)) 120 120 { … … 133 133 else 134 134 { 135 LogFunc(("IOMMU memory read failed. uDeviceId=%#x GCPhys=%#RGp cb=%zu rc=%Rrc\n", uDeviceId, GCPhys, cbRead, rc));135 LogFunc(("IOMMU memory read failed. idDevice=%#x GCPhys=%#RGp cb=%zu rc=%Rrc\n", idDevice, GCPhys, cbRead, rc)); 136 136 137 137 /* … … 174 174 && pDevInsIommu != pDevIns) 175 175 { 176 uint16_t const uDeviceId= pdmIommuGetPciDeviceId(pDevIns, pPciDev);176 uint16_t const idDevice = pdmIommuGetPciDeviceId(pDevIns, pPciDev); 177 177 int rc = VINF_SUCCESS; 178 178 while (cbWrite > 0) … … 180 180 RTGCPHYS GCPhysOut; 181 181 size_t cbContig; 182 rc = pIommu->pfnMemAccess(pDevInsIommu, uDeviceId, GCPhys, cbWrite, PDMIOMMU_MEM_F_WRITE, &GCPhysOut, &cbContig);182 rc = pIommu->pfnMemAccess(pDevInsIommu, idDevice, GCPhys, cbWrite, PDMIOMMU_MEM_F_WRITE, &GCPhysOut, &cbContig); 183 183 if (RT_SUCCESS(rc)) 184 184 { … … 197 197 else 198 198 { 199 LogFunc(("IOMMU memory write failed. uDeviceId=%#x GCPhys=%#RGp cb=%zu rc=%Rrc\n", uDeviceId, GCPhys, cbWrite,199 LogFunc(("IOMMU memory write failed. idDevice=%#x GCPhys=%#RGp cb=%zu rc=%Rrc\n", idDevice, GCPhys, cbWrite, 200 200 rc)); 201 201 break; … … 235 235 && pDevInsIommu != pDevIns) 236 236 { 237 uint16_t const uDeviceId= pdmIommuGetPciDeviceId(pDevIns, pPciDev);237 uint16_t const idDevice = pdmIommuGetPciDeviceId(pDevIns, pPciDev); 238 238 size_t cbContig = 0; 239 239 RTGCPHYS GCPhysOut = NIL_RTGCPHYS; 240 int rc = pIommu->pfnMemAccess(pDevInsIommu, uDeviceId, GCPhys & X86_PAGE_BASE_MASK, X86_PAGE_SIZE, PDMIOMMU_MEM_F_READ,240 int rc = pIommu->pfnMemAccess(pDevInsIommu, idDevice, GCPhys & X86_PAGE_BASE_MASK, X86_PAGE_SIZE, PDMIOMMU_MEM_F_READ, 241 241 &GCPhysOut, &cbContig); 242 242 if (RT_SUCCESS(rc)) … … 247 247 } 248 248 249 LogFunc(("IOMMU memory read for pointer access failed. uDeviceId=%#x GCPhys=%#RGp rc=%Rrc\n", uDeviceId, GCPhys, rc));249 LogFunc(("IOMMU memory read for pointer access failed. idDevice=%#x GCPhys=%#RGp rc=%Rrc\n", idDevice, GCPhys, rc)); 250 250 return rc; 251 251 } … … 280 280 && pDevInsIommu != pDevIns) 281 281 { 282 uint16_t const uDeviceId= pdmIommuGetPciDeviceId(pDevIns, pPciDev);282 uint16_t const idDevice = pdmIommuGetPciDeviceId(pDevIns, pPciDev); 283 283 size_t cbContig = 0; 284 284 RTGCPHYS GCPhysOut = NIL_RTGCPHYS; 285 int rc = pIommu->pfnMemAccess(pDevInsIommu, uDeviceId, GCPhys & X86_PAGE_BASE_MASK, X86_PAGE_SIZE, PDMIOMMU_MEM_F_WRITE,285 int rc = pIommu->pfnMemAccess(pDevInsIommu, idDevice, GCPhys & X86_PAGE_BASE_MASK, X86_PAGE_SIZE, PDMIOMMU_MEM_F_WRITE, 286 286 &GCPhysOut, &cbContig); 287 287 if (RT_SUCCESS(rc)) … … 292 292 } 293 293 294 LogFunc(("IOMMU memory write for pointer access failed. uDeviceId=%#x GCPhys=%#RGp rc=%Rrc\n", uDeviceId, GCPhys, rc));294 LogFunc(("IOMMU memory write for pointer access failed. idDevice=%#x GCPhys=%#RGp rc=%Rrc\n", idDevice, GCPhys, rc)); 295 295 return rc; 296 296 } … … 341 341 342 342 /* Ask the IOMMU for corresponding translated physical addresses. */ 343 uint16_t const uDeviceId= pdmIommuGetPciDeviceId(pDevIns, pPciDev);343 uint16_t const idDevice = pdmIommuGetPciDeviceId(pDevIns, pPciDev); 344 344 AssertCompile(sizeof(RTGCPHYS) == sizeof(uint64_t)); 345 int rc = pIommu->pfnMemBulkAccess(pDevInsIommu, uDeviceId, cPages, (uint64_t const *)paGCPhysPages, PDMIOMMU_MEM_F_READ,345 int rc = pIommu->pfnMemBulkAccess(pDevInsIommu, idDevice, cPages, (uint64_t const *)paGCPhysPages, PDMIOMMU_MEM_F_READ, 346 346 paGCPhysOut); 347 347 if (RT_SUCCESS(rc)) … … 353 353 } 354 354 else 355 LogFunc(("Bulk translation for read access failed. uDeviceId=%#x cPages=%zu rc=%Rrc\n", uDeviceId, cPages, rc));355 LogFunc(("Bulk translation for read access failed. idDevice=%#x cPages=%zu rc=%Rrc\n", idDevice, cPages, rc)); 356 356 357 357 RTMemFree(paGCPhysOut); … … 404 404 405 405 /* Ask the IOMMU for corresponding translated physical addresses. */ 406 uint16_t const uDeviceId= pdmIommuGetPciDeviceId(pDevIns, pPciDev);406 uint16_t const idDevice = pdmIommuGetPciDeviceId(pDevIns, pPciDev); 407 407 AssertCompile(sizeof(RTGCPHYS) == sizeof(uint64_t)); 408 int rc = pIommu->pfnMemBulkAccess(pDevInsIommu, uDeviceId, cPages, (uint64_t const *)paGCPhysPages, PDMIOMMU_MEM_F_WRITE,408 int rc = pIommu->pfnMemBulkAccess(pDevInsIommu, idDevice, cPages, (uint64_t const *)paGCPhysPages, PDMIOMMU_MEM_F_WRITE, 409 409 paGCPhysOut); 410 410 if (RT_SUCCESS(rc)) … … 416 416 } 417 417 else 418 LogFunc(("IOMMU bulk translation failed. uDeviceId=%#x cPages=%zu rc=%Rrc\n", uDeviceId, cPages, rc));418 LogFunc(("IOMMU bulk translation failed. idDevice=%#x cPages=%zu rc=%Rrc\n", idDevice, cPages, rc)); 419 419 420 420 RTMemFree(paGCPhysOut); -
trunk/src/VBox/VMM/VMMR0/PDMR0DevHlp.cpp
r88075 r88078 1524 1524 1525 1525 /** @interface_method_impl{PDMIOAPICHLP,pfnIommuMsiRemap} */ 1526 static DECLCALLBACK(int) pdmR0IoApicHlp_IommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut)1526 static DECLCALLBACK(int) pdmR0IoApicHlp_IommuMsiRemap(PPDMDEVINS pDevIns, uint16_t idDevice, PCMSIMSG pMsiIn, PMSIMSG pMsiOut) 1527 1527 { 1528 1528 PDMDEV_ASSERT_DEVINS(pDevIns); … … 1531 1531 1532 1532 #ifdef VBOX_WITH_IOMMU_AMD 1533 int rc = pdmIommuMsiRemap(pDevIns, uDeviceId, pMsiIn, pMsiOut);1533 int rc = pdmIommuMsiRemap(pDevIns, idDevice, pMsiIn, pMsiOut); 1534 1534 if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT) 1535 1535 return rc; 1536 1536 #else 1537 RT_NOREF(pDevIns, uDeviceId);1537 RT_NOREF(pDevIns, idDevice); 1538 1538 #endif 1539 1539 -
trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
r88075 r88078 142 142 143 143 /** @interface_method_impl{PDMIOAPICHLP,pfnIommuMsiRemap} */ 144 static DECLCALLBACK(int) pdmR3IoApicHlp_IommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut)144 static DECLCALLBACK(int) pdmR3IoApicHlp_IommuMsiRemap(PPDMDEVINS pDevIns, uint16_t idDevice, PCMSIMSG pMsiIn, PMSIMSG pMsiOut) 145 145 { 146 146 PDMDEV_ASSERT_DEVINS(pDevIns); … … 149 149 150 150 #ifdef VBOX_WITH_IOMMU_AMD 151 int rc = pdmIommuMsiRemap(pDevIns, uDeviceId, pMsiIn, pMsiOut);151 int rc = pdmIommuMsiRemap(pDevIns, idDevice, pMsiIn, pMsiOut); 152 152 if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT) 153 153 return rc; 154 154 #else 155 RT_NOREF(pDevIns, uDeviceId);155 RT_NOREF(pDevIns, idDevice); 156 156 #endif 157 157
Note:
See TracChangeset
for help on using the changeset viewer.