Changeset 87499 in vbox
- Timestamp:
- Feb 1, 2021 1:55:23 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp
r87496 r87499 371 371 STAMCOUNTER StatCmdInvIommuAll; /**< Number of Invalidate IOMMU All commands processed. */ 372 372 373 STAMCOUNTER StatDteLookupNonContig; /**< Number of non-contiguous address region translations. */ 373 374 STAMPROFILEADV StatDteLookup; /**< Profiling of device table entry lookup (uncached). */ 374 375 /** @} */ … … 2964 2965 uint64_t offIova = uIova & X86_PAGE_4K_OFFSET_MASK; 2965 2966 uint64_t cbPages = 0; 2967 #ifdef IOMMU_WITH_IOTLBE_CACHE 2968 IOWALKRESULT WalkResultPrev; 2969 RT_ZERO(WalkResultPrev); 2970 #endif 2966 2971 for (;;) 2967 2972 { … … 2976 2981 uint64_t const offSpa = uIova & offMask; 2977 2982 GCPhysSpa = WalkResult.GCPhysSpa | offSpa; 2983 #ifdef IOMMU_WITH_IOTLBE_CACHE 2984 /* Store the walk result from the first page. */ 2985 WalkResultPrev = WalkResult; 2986 #endif 2978 2987 } 2988 #ifdef IOMMU_WITH_IOTLBE_CACHE 2989 /* Check if addresses translated so far result in a physically contiguous region 2990 and that permissions and page sizes are identical for all pages in the access. */ 2991 else if ( (GCPhysSpa & X86_PAGE_4K_BASE_MASK) + cbPages == WalkResult.GCPhysSpa 2992 && WalkResultPrev.cShift == WalkResult.cShift 2993 && WalkResultPrev.fIoPerm == WalkResult.fIoPerm) 2994 { 2995 /* Paranoia. */ 2996 Assert((WalkResultPrev.GCPhysSpa & X86_PAGE_4K_BASE_MASK) 2997 + RT_BIT_64(WalkResultPrev.cShift) == WalkResult.GCPhysSpa); 2998 /* Store the walk result before moving on to the next page. */ 2999 WalkResultPrev = WalkResult; 3000 } 3001 #else 2979 3002 /* Check if addresses translated so far result in a physically contiguous region. */ 2980 else if ( (GCPhysSpa & X86_PAGE_4K_BASE_MASK) + cbPages == WalkResult.GCPhysSpa)3003 else if ( (GCPhysSpa & X86_PAGE_4K_BASE_MASK) + cbPages == WalkResult.GCPhysSpa) 2981 3004 { /* likely */ } 3005 #endif 2982 3006 else 3007 { 3008 STAM_COUNTER_INC(&pThis->StatDteLookupNonContig); 2983 3009 break; 3010 } 2984 3011 2985 3012 /* Check if we need to access more pages. */ 2986 uint64_t const cbPage = UINT64_C(1) << WalkResult.cShift;3013 uint64_t const cbPage = RT_BIT_64(WalkResult.cShift); 2987 3014 if (cbRemaining > cbPage - offIova) 2988 3015 { … … 3018 3045 3019 3046 /* Paranoia. */ 3020 Assert(WalkResult.cShift == 0);3047 Assert(WalkResult.cShift == 0); 3021 3048 Assert(WalkResult.GCPhysSpa == uIova); 3022 3049 Assert((WalkResult.fIoPerm & fAccess) == fAccess); … … 5131 5158 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatCmdCompletePprReq, STAMTYPE_COUNTER, "R3/Commands/CompletePprReq", STAMUNIT_OCCURENCES, "Number of Complete PPR Requests commands processed."); 5132 5159 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatCmdInvIommuAll, STAMTYPE_COUNTER, "R3/Commands/InvIommuAll", STAMUNIT_OCCURENCES, "Number of Invalidate IOMMU All commands processed."); 5160 5161 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatDteLookupNonContig, STAMTYPE_COUNTER, "DteLookupNonContig", STAMUNIT_OCCURENCES, "Number of non-contiguous translated regions."); 5133 5162 5134 5163 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatDteLookup, STAMTYPE_PROFILE, "DteLookup", STAMUNIT_TICKS_PER_CALL, "Profiling device table entry lookup (uncached).");
Note:
See TracChangeset
for help on using the changeset viewer.