Changeset 87866 in vbox
- Timestamp:
- Feb 25, 2021 5:06:57 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r87848 r87866 1159 1159 Assert(pThisR3->cCachedIotlbes < IOMMU_IOTLBE_MAX); 1160 1160 ++pThisR3->cCachedIotlbes; 1161 STAM_COUNTER_INC(&pThis->StatIotlbeCached); 1161 STAM_COUNTER_INC(&pThis->StatIotlbeCached); NOREF(pThis); 1162 1162 } 1163 1163 else … … 1167 1167 { 1168 1168 pFound->fEvictPending = false; 1169 STAM_COUNTER_INC(&pThis->StatIotlbeLazyEvictReuse); 1169 STAM_COUNTER_INC(&pThis->StatIotlbeLazyEvictReuse); NOREF(pThis); 1170 1170 } 1171 1171 Assert(pFound->PageLookup.cShift == pPageLookup->cShift); … … 1201 1201 Assert(pThisR3->cCachedIotlbes > 0); 1202 1202 --pThisR3->cCachedIotlbes; 1203 STAM_COUNTER_DEC(&pThis->StatIotlbeCached); 1203 STAM_COUNTER_DEC(&pThis->StatIotlbeCached); NOREF(pThis); 1204 1204 } 1205 1205 return pIotlbe; … … 3800 3800 STAM_PROFILE_ADV_START(&pThis->StatProfDteLookup, a); 3801 3801 int rc = iommuAmdIoPageTableWalk(pDevIns, uIovaPage, fPerm, pAux->uDeviceId, pAux->pDte, pAux->enmOp, pPageLookup); 3802 STAM_PROFILE_ADV_STOP(&pThis->StatProfDteLookup, a); 3802 STAM_PROFILE_ADV_STOP(&pThis->StatProfDteLookup, a); NOREF(pThis); 3803 3803 return rc; 3804 3804 } … … 3962 3962 Assert(cbContiguous > 0 && cbContiguous < cbAccess); 3963 3963 rc = VINF_SUCCESS; 3964 STAM_COUNTER_INC(&pThis->StatAccessDteNonContig); 3964 STAM_COUNTER_INC(&pThis->StatAccessDteNonContig); NOREF(pThis); 3965 3965 } 3966 3966 … … 4196 4196 * @param penmOp Where to store the IOMMU operation. 4197 4197 * @param pfPerm Where to store the IOMMU I/O permission. 4198 * @param pStatRead The stat counter to increment for a read operation. 4199 * @param pStatWrite The stat counter to increment for a write operation. 4200 */ 4201 DECLINLINE(void) iommuAmdMemAccessGetPermAndOp(uint32_t fFlags, PIOMMUOP penmOp, uint8_t *pfPerm, PSTAMCOUNTER pStatRead, 4202 PSTAMCOUNTER pStatWrite) 4198 * @param fBulk Whether this is a bulk read or write. 4199 */ 4200 DECLINLINE(void) iommuAmdMemAccessGetPermAndOp(uint32_t fFlags, PIOMMUOP penmOp, uint8_t *pfPerm, bool fBulk) 4203 4201 { 4204 4202 if (fFlags & PDMIOMMU_MEM_F_WRITE) … … 4206 4204 *penmOp = IOMMUOP_MEM_WRITE; 4207 4205 *pfPerm = IOMMU_IO_PERM_WRITE; 4208 STAM_COUNTER_INC(pStatWrite); 4206 #ifdef VBOX_WITH_STATISTICS 4207 if (!fBulk) 4208 STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemRead)); 4209 else 4210 STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemBulkRead)); 4211 #else 4212 RT_NOREF(fBulk); 4213 #endif 4209 4214 } 4210 4215 else … … 4213 4218 *penmOp = IOMMUOP_MEM_READ; 4214 4219 *pfPerm = IOMMU_IO_PERM_READ; 4215 STAM_COUNTER_INC(pStatRead); 4220 #ifdef VBOX_WITH_STATISTICS 4221 if (!fBulk) 4222 STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemWrite)); 4223 else 4224 STAM_COUNTER_INC(pThis->CTX_SUFF_Z(StatMemBulkWrite)); 4225 #else 4226 RT_NOREF(fBulk); 4227 #endif 4216 4228 } 4217 4229 } … … 4248 4260 IOMMUOP enmOp; 4249 4261 uint8_t fPerm; 4250 iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, &pThis->CTX_SUFF_Z(StatMemRead), &pThis->CTX_SUFF_Z(StatMemWrite));4262 iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, false /* fBulk */); 4251 4263 LogFlowFunc(("%s: uDevId=%#x uIova=%#RX64 cb=%zu\n", iommuAmdMemAccessGetPermName(fPerm), uDevId, uIova, cbAccess)); 4264 NOREF(pThis); 4252 4265 4253 4266 int rc; … … 4257 4270 if (rc == VINF_SUCCESS) 4258 4271 { 4259 /* Entire access was cached and permissions were valid. */4272 /* All pages in the access were found in the cache with sufficient permissions. */ 4260 4273 Assert(*pcbContiguous == cbAccess); 4261 4274 Assert(*pGCPhysSpa != NIL_RTGCPHYS); … … 4267 4280 else 4268 4281 { 4269 /* Access stopped whentranslations resulted in non-contiguous memory, let caller resume access. */4282 /* Access stopped since translations resulted in non-contiguous memory, let caller resume access. */ 4270 4283 Assert(*pcbContiguous > 0 && *pcbContiguous < cbAccess); 4271 4284 STAM_COUNTER_INC(&pThis->StatAccessCacheNonContig); … … 4281 4294 uIova += *pcbContiguous; 4282 4295 cbAccess -= *pcbContiguous; 4283 /* FYI: We currently would be also be including permission deniedas cache misses too.*/4296 /* We currently are including any permission denied pages as cache misses too.*/ 4284 4297 STAM_COUNTER_INC(&pThis->StatAccessCacheMiss); 4285 4298 #endif … … 4335 4348 IOMMUOP enmOp; 4336 4349 uint8_t fPerm; 4337 iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, &pThis->CTX_SUFF_Z(StatMemBulkRead), 4338 &pThis->CTX_SUFF_Z(StatMemBulkWrite)); 4350 iommuAmdMemAccessGetPermAndOp(fFlags, &enmOp, &fPerm, true /* fBulk */); 4339 4351 LogFlowFunc(("%s: uDevId=%#x cIovas=%zu\n", iommuAmdMemAccessGetPermName(fPerm), uDevId, cIovas)); 4340 4352
Note:
See TracChangeset
for help on using the changeset viewer.