- Timestamp:
- Jun 5, 2024 8:33:10 PM (8 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r104848 r104859 589 589 { 590 590 PGM_LOCK_VOID(pVM); 591 RT_ZERO(pVM->pgm.s.apRamRangesTlbR3); 592 RT_ZERO(pVM->pgm.s.apRamRangesTlbR0); 591 /* This is technically only required when freeing the PCNet MMIO2 range 592 during ancient saved state loading. The code freeing the RAM range 593 will make sure this function is called in both rings. */ 594 RT_ZERO(pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb); 593 595 PGM_UNLOCK(pVM); 594 596 } … … 630 632 PPGMRAMRANGE const pRamRange = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRanges[idRamRange]; 631 633 Assert(pRamRange); 632 pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange;634 pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange; 633 635 return pRamRange; 634 636 } … … 677 679 PPGMRAMRANGE const pRamRange = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRanges[idRamRange]; 678 680 Assert(pRamRange); 679 pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange;681 pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange; 680 682 return pRamRange; 681 683 } … … 731 733 PPGMRAMRANGE const pRamRange = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRanges[idRamRange]; 732 734 AssertReturn(pRamRange, NULL); 733 pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange;735 pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange; 734 736 735 737 /* Get the page. */ … … 784 786 PPGMRAMRANGE const pRamRange = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRanges[idRamRange]; 785 787 AssertReturn(pRamRange, VERR_PGM_PHYS_RAM_LOOKUP_IPE); 786 pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange;788 pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange; 787 789 788 790 /* Get the page. */ … … 840 842 PPGMRAMRANGE const pRamRange = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRanges[idRamRange]; 841 843 AssertReturn(pRamRange, VERR_PGM_PHYS_RAM_LOOKUP_IPE); 842 pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange;844 pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRamRange; 843 845 844 846 /* Get the page. */ … … 1103 1105 } 1104 1106 1107 /* 1108 * Make sure the RAM range TLB does not contain any stale pointers to this range. 1109 */ 1110 pgmPhysInvalidRamRangeTlbs(pVM); 1105 1111 return rc; 1106 1112 } -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r104855 r104859 2852 2852 2853 2853 pgmPhysInvalidatePageMapTLB(pVM); 2854 pgmPhysInvalidRamRangeTlbs(pVM);2854 /*pgmPhysInvalidRamRangeTlbs(pVM); - not necessary */ 2855 2855 2856 2856 return rc; … … 3403 3403 rc2, idx, cChunks, pszDesc), 3404 3404 rc = RT_SUCCESS(rc) ? rc2 : rc); 3405 pgmPhysInvalidRamRangeTlbs(pVM); /* Ensure no stale pointers in the ring-3 RAM range TLB. */ 3405 3406 } 3406 3407 if (RT_FAILURE(rc2)) … … 3905 3906 3906 3907 pgmPhysInvalidatePageMapTLB(pVM); 3907 pgmPhysInvalidRamRangeTlbs(pVM);3908 /* pgmPhysInvalidRamRangeTlbs(pVM); - not necessary */ 3908 3909 3909 3910 return rcRet; -
trunk/src/VBox/VMM/include/PGMInline.h
r103374 r104859 71 71 DECLINLINE(PPGMRAMRANGE) pgmPhysGetRange(PVMCC pVM, RTGCPHYS GCPhys) 72 72 { 73 PPGMRAMRANGE pRam = pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)];73 PPGMRAMRANGE pRam = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)]; 74 74 if (!pRam || GCPhys - pRam->GCPhys >= pRam->cb) 75 75 return pgmPhysGetRangeSlow(pVM, GCPhys); … … 91 91 DECLINLINE(PPGMRAMRANGE) pgmPhysGetRangeAtOrAbove(PVMCC pVM, RTGCPHYS GCPhys) 92 92 { 93 PPGMRAMRANGE pRam = pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)];93 PPGMRAMRANGE pRam = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)]; 94 94 if ( !pRam 95 95 || (GCPhys - pRam->GCPhys) >= pRam->cb) … … 111 111 DECLINLINE(PPGMPAGE) pgmPhysGetPage(PVMCC pVM, RTGCPHYS GCPhys) 112 112 { 113 PPGMRAMRANGE pRam = pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)];113 PPGMRAMRANGE pRam = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)]; 114 114 RTGCPHYS off; 115 115 if ( pRam … … 138 138 DECLINLINE(int) pgmPhysGetPageEx(PVMCC pVM, RTGCPHYS GCPhys, PPPGMPAGE ppPage) 139 139 { 140 PPGMRAMRANGE pRam = pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)];140 PPGMRAMRANGE pRam = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)]; 141 141 RTGCPHYS off; 142 142 if ( !pRam … … 171 171 || RT_UNLIKELY((off = GCPhys - pRam->GCPhys) >= pRam->cb)) 172 172 { 173 pRam = pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)];173 pRam = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)]; 174 174 if ( !pRam 175 175 || (off = GCPhys - pRam->GCPhys) >= pRam->cb) … … 197 197 DECLINLINE(int) pgmPhysGetPageAndRangeEx(PVMCC pVM, RTGCPHYS GCPhys, PPPGMPAGE ppPage, PPGMRAMRANGE *ppRam) 198 198 { 199 PPGMRAMRANGE pRam = pVM-> pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)];199 PPGMRAMRANGE pRam = pVM->CTX_EXPR(pgm, pgmr0, pgm).s.apRamRangesTlb[PGM_RAMRANGE_TLB_IDX(GCPhys)]; 200 200 RTGCPHYS off; 201 201 if ( !pRam -
trunk/src/VBox/VMM/include/PGMInternal.h
r104840 r104859 1413 1413 /** The number of entries in the RAM range TLBs (there is one for each 1414 1414 * context). Must be a power of two. */ 1415 #define PGM_RAMRANGE_TLB_ENTRIES 81415 #define PGM_RAMRANGE_TLB_ENTRIES 16 1416 1416 1417 1417 /** … … 3112 3112 3113 3113 /** RAM range TLB for R3. */ 3114 R3PTRTYPE(PPGMRAMRANGE) apRamRangesTlb R3[PGM_RAMRANGE_TLB_ENTRIES];3114 R3PTRTYPE(PPGMRAMRANGE) apRamRangesTlb[PGM_RAMRANGE_TLB_ENTRIES]; 3115 3115 /** Shadow Page Pool - R3 Ptr. */ 3116 3116 R3PTRTYPE(PPGMPOOL) pPoolR3; 3117 /** Pointer to the list of ROM ranges - for R3. 3118 * This is sorted by physical address and contains no overlapping ranges. */ 3119 R3PTRTYPE(PPGMROMRANGE) pRomRangesR3; 3120 3121 /** RAM range TLB for R0. */ 3122 R0PTRTYPE(PPGMRAMRANGE) apRamRangesTlbR0[PGM_RAMRANGE_TLB_ENTRIES]; 3117 3123 3118 /** Shadow Page Pool - R0 Ptr. */ 3124 3119 R0PTRTYPE(PPGMPOOL) pPoolR0; 3125 /** R0 pointer corresponding to PGM::pRomRangesR3. */3126 R0PTRTYPE(PPGMROMRANGE) pRomRangesR0;3127 3120 3128 3121 /** Hack: Number of deprecated page mapping locks taken by the current lock … … 3146 3139 uint32_t idxLastPhysHandler; 3147 3140 3148 uint32_t au64Padding3[ 5];3141 uint32_t au64Padding3[9]; 3149 3142 3150 3143 /** PGM critical section. … … 3763 3756 uint32_t idRamRangeMax; 3764 3757 uint8_t abAlignment1[64 - sizeof(uint32_t)]; 3758 /** RAM range TLB for R0. */ 3759 R0PTRTYPE(PPGMRAMRANGE) apRamRangesTlb[PGM_RAMRANGE_TLB_ENTRIES]; 3765 3760 /** @} */ 3766 3761
Note:
See TracChangeset
for help on using the changeset viewer.