Changeset 87943 in vbox for trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
- Timestamp:
- Mar 4, 2021 5:23:02 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r87926 r87943 4087 4087 4088 4088 /** 4089 * Lookups a memory access from the IO MMUcache.4089 * Lookups a memory access from the IOTLB cache. 4090 4090 * 4091 4091 * @returns VBox status code. … … 4108 4108 * and permission-checked. 4109 4109 */ 4110 static int iommuAmd CacheLookup(PPDMDEVINS pDevIns, uint16_t idDevice, uint64_t uIova, size_t cbIova, uint8_t fPerm, IOMMUOP enmOp,4111 PRTGCPHYS pGCPhysSpa, size_t *pcbContiguous)4110 static int iommuAmdIotlbCacheLookup(PPDMDEVINS pDevIns, uint16_t idDevice, uint64_t uIova, size_t cbIova, uint8_t fPerm, 4111 IOMMUOP enmOp, PRTGCPHYS pGCPhysSpa, size_t *pcbContiguous) 4112 4112 { 4113 4113 int rc; … … 4267 4267 #ifdef IOMMU_WITH_IOTLBE_CACHE 4268 4268 /* Lookup the IOVA from the cache. */ 4269 rc = iommuAmd CacheLookup(pDevIns, idDevice, uIova, cbIova, fPerm, enmOp, pGCPhysSpa, pcbContiguous);4269 rc = iommuAmdIotlbCacheLookup(pDevIns, idDevice, uIova, cbIova, fPerm, enmOp, pGCPhysSpa, pcbContiguous); 4270 4270 if (rc == VINF_SUCCESS) 4271 4271 { … … 4274 4274 Assert(*pGCPhysSpa != NIL_RTGCPHYS); 4275 4275 STAM_COUNTER_INC(&pThis->StatAccessCacheHitFull); 4276 return rc;4276 return VINF_SUCCESS; 4277 4277 } 4278 4278 if (rc != VERR_OUT_OF_RANGE) … … 4351 4351 LogFlowFunc(("%s: idDevice=%#x cIovas=%zu\n", iommuAmdMemAccessGetPermName(fPerm), idDevice, cIovas)); 4352 4352 4353 /** @todo IOMMU: IOTLB cache lookup. */4354 4355 /* Lookup each IOVA from the device table. */4356 4353 for (size_t i = 0; i < cIovas; i++) 4357 4354 { 4355 int rc; 4358 4356 size_t cbContig; 4359 int rc = iommuAmdDteLookup(pDevIns, idDevice, pauIovas[i], X86_PAGE_SIZE, fPerm, enmOp, &paGCPhysSpa[i], &cbContig); 4357 4358 #ifdef IOMMU_WITH_IOTLBE_CACHE 4359 /* Lookup the IOVA from the IOTLB cache. */ 4360 rc = iommuAmdIotlbCacheLookup(pDevIns, idDevice, pauIovas[i], X86_PAGE_SIZE, fPerm, enmOp, &paGCPhysSpa[i], 4361 &cbContig); 4362 if (rc == VINF_SUCCESS) 4363 { 4364 Assert(cbContig == X86_PAGE_SIZE); 4365 Assert(paGCPhysSpa[i] != NIL_RTGCPHYS); 4366 STAM_COUNTER_INC(&pThis->StatAccessCacheHitFull); 4367 continue; 4368 } 4369 Assert(rc == VERR_NOT_FOUND || rc == VERR_IOMMU_ADDR_ACCESS_DENIED); 4370 STAM_COUNTER_INC(&pThis->StatAccessCacheMiss); 4371 #endif 4372 4373 /* Lookup the IOVA from the device table. */ 4374 rc = iommuAmdDteLookup(pDevIns, idDevice, pauIovas[i], X86_PAGE_SIZE, fPerm, enmOp, &paGCPhysSpa[i], &cbContig); 4360 4375 if (RT_SUCCESS(rc)) 4361 4376 { /* likely */ }
Note:
See TracChangeset
for help on using the changeset viewer.