Changeset 86319 in vbox
- Timestamp:
- Sep 28, 2020 1:43:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r86313 r86319 3027 3027 if (cbRemaining == cbAccess) 3028 3028 { 3029 RTGCPHYS const offSpa = ~(UINT64_C(0xffffffffffffffff) << WalkResult.cShift); 3029 uint64_t const offMask = ~(UINT64_C(0xffffffffffffffff) << WalkResult.cShift); 3030 uint64_t const offSpa = uIova & offMask; 3030 3031 *pGCPhysSpa = WalkResult.GCPhysSpa | offSpa; 3031 3032 } 3032 3033 3034 /* If the access exceeds the page size, check permissions for the subsequent page. */ 3033 3035 uint64_t const cbPhysPage = UINT64_C(1) << WalkResult.cShift; 3034 3036 if (cbRemaining > cbPhysPage - offIova) 3035 3037 { 3036 3038 cbRemaining -= (cbPhysPage - offIova); 3037 uBaseIova += cbPhysPage; 3039 uBaseIova += cbPhysPage; /** @todo r=ramshankar: Should we mask the offset based on page size here? */ 3038 3040 offIova = 0; 3039 3041 } … … 3085 3087 { 3086 3088 STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatMemRead)); 3087 LogF lowFunc(("uDevId=%#x uIova=%#RX64 cbRead=%u\n", uDevId, uIova, cbRead));3089 LogFunc(("uDevId=%#x uIova=%#RX64 cbRead=%u\n", uDevId, uIova, cbRead)); 3088 3090 3089 3091 /** @todo IOMMU: IOTLB cache lookup. */ 3090 3092 3091 3093 /* Lookup the IOVA from the device table. */ 3092 return iommuAmdLookupDeviceTable(pDevIns, uDevId, uIova, cbRead, IOMMU_IO_PERM_READ, IOMMUOP_MEM_READ, pGCPhysSpa); 3094 int rc = iommuAmdLookupDeviceTable(pDevIns, uDevId, uIova, cbRead, IOMMU_IO_PERM_READ, IOMMUOP_MEM_READ, pGCPhysSpa); 3095 if (RT_SUCCESS(rc)) 3096 LogFlowFunc(("uDevId=%#x uIova=%#RX64 cRead=%u pGCPhysSpa=%#RGp\n", uDevId, uIova, cbRead, *pGCPhysSpa)); 3097 else 3098 LogFunc(("Failed! uDevId=%#x uIova=%#RX64 cbWrite=%u rc=%Rrc\n", uDevId, uIova, cbRead, rc)); 3099 return rc; 3093 3100 } 3094 3101 … … 3125 3132 { 3126 3133 STAM_COUNTER_INC(&pThis->CTX_SUFF_Z(StatMemWrite)); 3127 LogFlowFunc(("uDevId=%#x uIova=%#RX64 cbWrite=%u\n", uDevId, uIova, cbWrite));3128 3134 3129 3135 /** @todo IOMMU: IOTLB cache lookup. */ 3130 3136 3131 3137 /* Lookup the IOVA from the device table. */ 3132 return iommuAmdLookupDeviceTable(pDevIns, uDevId, uIova, cbWrite, IOMMU_IO_PERM_WRITE, IOMMUOP_MEM_WRITE, pGCPhysSpa); 3138 int rc = iommuAmdLookupDeviceTable(pDevIns, uDevId, uIova, cbWrite, IOMMU_IO_PERM_WRITE, IOMMUOP_MEM_WRITE, pGCPhysSpa); 3139 if (RT_SUCCESS(rc)) 3140 LogFlowFunc(("uDevId=%#x uIova=%#RX64 cbWrite=%u pGCPhysSpa=%#RGp\n", uDevId, uIova, cbWrite, *pGCPhysSpa)); 3141 else 3142 LogFunc(("Failed! uDevId=%#x uIova=%#RX64 cbWrite=%u rc=%Rrc\n", uDevId, uIova, cbWrite, rc)); 3143 return rc; 3133 3144 } 3134 3145
Note:
See TracChangeset
for help on using the changeset viewer.