Changeset 87494 in vbox
- Timestamp:
- Feb 1, 2021 5:47:40 AM (4 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PDMAllIommu.cpp
r87483 r87494 63 63 #endif 64 64 return PCIBDF_MAKE(pBus->iBus, pPciDev->uDevFn); 65 } 66 67 68 /** @copydoc PDMIOMMUREGR3::pfnMsiRemap */ 69 int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut) 70 { 71 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 72 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); 73 if ( pDevInsIommu 74 && pDevInsIommu != pDevIns) 75 { 76 int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDeviceId, pMsiIn, pMsiOut); 77 if (RT_FAILURE(rc)) 78 { 79 LogFunc(("MSI remap failed. uDeviceId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n", uDeviceId, pMsiIn->Addr.u64, 80 pMsiIn->Data.u32, rc)); 81 } 82 return rc; 83 } 84 return VERR_IOMMU_NOT_PRESENT; 65 85 } 66 86 … … 178 198 179 199 200 #ifdef IN_RING3 180 201 /** 181 202 * Requests the mapping of a guest page into ring-3 in preparation for a bus master … … 196 217 * pfnPhysReleasePageMappingLock needs. 197 218 */ 198 int pdmIommuMemAccessReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv, 199 PPGMPAGEMAPLOCK pLock) 200 { 201 #if defined(IN_RING3) 219 int pdmR3IommuMemAccessReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv, 220 PPGMPAGEMAPLOCK pLock) 221 { 202 222 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 203 223 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); … … 221 241 } 222 242 return VERR_IOMMU_NOT_PRESENT; 223 #else224 RT_NOREF6(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);225 return VERR_NOT_IMPLEMENTED;226 #endif227 243 } 228 244 … … 246 262 * pfnPhysReleasePageMappingLock needs. 247 263 */ 248 int pdmIommuMemAccessWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, 249 PPGMPAGEMAPLOCK pLock) 250 { 251 #if defined(IN_RING3) 264 int pdmR3IommuMemAccessWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, 265 PPGMPAGEMAPLOCK pLock) 266 { 252 267 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 253 268 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); … … 271 286 } 272 287 return VERR_IOMMU_NOT_PRESENT; 273 #else274 RT_NOREF6(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);275 return VERR_NOT_IMPLEMENTED;276 #endif277 288 } 278 289 … … 299 310 * in length). 300 311 */ 301 int pdmIommuMemAccessBulkReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, 302 uint32_t fFlags, const void **papvPages, PPGMPAGEMAPLOCK paLocks) 303 { 304 #ifdef IN_RING3 312 int pdmR3IommuMemAccessBulkReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, 313 uint32_t fFlags, const void **papvPages, PPGMPAGEMAPLOCK paLocks) 314 { 305 315 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 306 316 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); … … 339 349 } 340 350 return VERR_IOMMU_NOT_PRESENT; 341 #else342 RT_NOREF7(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);343 return VERR_NOT_IMPLEMENTED;344 #endif345 351 } 346 352 … … 367 373 * in length). 368 374 */ 369 int pdmIommuMemAccessBulkWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, 370 uint32_t fFlags, void **papvPages, PPGMPAGEMAPLOCK paLocks) 371 { 372 #ifdef IN_RING3 375 int pdmR3IommuMemAccessBulkWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, 376 uint32_t fFlags, void **papvPages, PPGMPAGEMAPLOCK paLocks) 377 { 373 378 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 374 379 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); … … 407 412 } 408 413 return VERR_IOMMU_NOT_PRESENT; 409 #else 410 RT_NOREF7(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks); 411 return VERR_NOT_IMPLEMENTED; 412 #endif 413 } 414 415 416 /** @copydoc PDMIOMMUREGR3::pfnMsiRemap */ 417 int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut) 418 { 419 PPDMIOMMU pIommu = PDMDEVINS_TO_IOMMU(pDevIns); 420 PPDMDEVINS pDevInsIommu = pIommu->CTX_SUFF(pDevIns); 421 if ( pDevInsIommu 422 && pDevInsIommu != pDevIns) 423 { 424 int rc = pIommu->pfnMsiRemap(pDevInsIommu, uDeviceId, pMsiIn, pMsiOut); 425 if (RT_FAILURE(rc)) 426 { 427 LogFunc(("MSI remap failed. uDeviceId=%#x pMsiIn=(%#RX64, %#RU32) rc=%Rrc\n", uDeviceId, pMsiIn->Addr.u64, 428 pMsiIn->Data.u32, rc)); 429 } 430 return rc; 431 } 432 return VERR_IOMMU_NOT_PRESENT; 433 } 434 414 } 415 #endif /* IN_RING3 */ 416 -
trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
r87478 r87494 1886 1886 1887 1887 #ifdef VBOX_WITH_IOMMU_AMD 1888 int rc = pdm IommuMemAccessWriteCCPtr(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);1888 int rc = pdmR3IommuMemAccessWriteCCPtr(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock); 1889 1889 if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT) 1890 1890 return rc; … … 1917 1917 1918 1918 #ifdef VBOX_WITH_IOMMU_AMD 1919 int rc = pdm IommuMemAccessReadCCPtr(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock);1919 int rc = pdmR3IommuMemAccessReadCCPtr(pDevIns, pPciDev, GCPhys, fFlags, ppv, pLock); 1920 1920 if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT) 1921 1921 return rc; … … 1949 1949 1950 1950 #ifdef VBOX_WITH_IOMMU_AMD 1951 int rc = pdm IommuMemAccessBulkWriteCCPtr(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);1951 int rc = pdmR3IommuMemAccessBulkWriteCCPtr(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks); 1952 1952 if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT) 1953 1953 return rc; … … 1981 1981 1982 1982 #ifdef VBOX_WITH_IOMMU_AMD 1983 int rc = pdm IommuMemAccessBulkReadCCPtr(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks);1983 int rc = pdmR3IommuMemAccessBulkReadCCPtr(pDevIns, pPciDev, cPages, paGCPhysPages, fFlags, papvPages, paLocks); 1984 1984 if (RT_SUCCESS(rc) || rc != VERR_IOMMU_NOT_PRESENT) 1985 1985 return rc; -
trunk/src/VBox/VMM/include/PDMInternal.h
r87478 r87494 1672 1672 1673 1673 #ifdef VBOX_WITH_IOMMU_AMD 1674 int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut); 1674 1675 int pdmIommuMemAccessRead(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead, uint32_t fFlags); 1675 1676 int pdmIommuMemAccessWrite(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite, uint32_t fFlags); 1676 int pdmIommuMemAccessReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv, PPGMPAGEMAPLOCK pLock); 1677 int pdmIommuMemAccessWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, PPGMPAGEMAPLOCK pLock); 1678 int pdmIommuMemAccessBulkReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, uint32_t fFlags, const void **papvPages, PPGMPAGEMAPLOCK paLocks); 1679 int pdmIommuMemAccessBulkWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, uint32_t fFlags, void **papvPages, PPGMPAGEMAPLOCK paLocks); 1680 int pdmIommuMsiRemap(PPDMDEVINS pDevIns, uint16_t uDeviceId, PCMSIMSG pMsiIn, PMSIMSG pMsiOut); 1677 # ifdef IN_RING3 1678 int pdmR3IommuMemAccessReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv, PPGMPAGEMAPLOCK pLock); 1679 int pdmR3IommuMemAccessWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, PPGMPAGEMAPLOCK pLock); 1680 int pdmR3IommuMemAccessBulkReadCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, uint32_t fFlags, const void **papvPages, PPGMPAGEMAPLOCK paLocks); 1681 int pdmR3IommuMemAccessBulkWriteCCPtr(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, uint32_t cPages, PCRTGCPHYS paGCPhysPages, uint32_t fFlags, void **papvPages, PPGMPAGEMAPLOCK paLocks); 1682 # endif 1681 1683 #endif 1682 1684
Note:
See TracChangeset
for help on using the changeset viewer.