Changeset 37137 in vbox
- Timestamp:
- May 18, 2011 2:49:39 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71810
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r36902 r37137 180 180 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,RamRangeTlbMisses)); 181 181 182 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES183 182 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangeTree); 184 183 while (pRam) … … 196 195 } 197 196 return NULL; 198 #else199 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);200 while (GCPhys > pRam->GCPhysLast)201 {202 pRam = pRam->CTX_SUFF(pNext);203 if (!pRam)204 return NULL;205 }206 if (GCPhys < pRam->GCPhys)207 return NULL;208 209 pVM->pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRam;210 return pRam;211 #endif212 197 } 213 198 … … 222 207 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,RamRangeTlbMisses)); 223 208 224 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES225 209 PPGMRAMRANGE pLastLeft = NULL; 226 210 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangeTree); … … 242 226 } 243 227 return pLastLeft; 244 #else245 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);246 while (GCPhys > pRam->GCPhysLast)247 {248 pRam = pRam->CTX_SUFF(pNext);249 if (!pRam)250 return NULL;251 }252 pVM->pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRam;253 return pRam;254 #endif255 228 } 256 229 … … 265 238 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,RamRangeTlbMisses)); 266 239 267 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES268 240 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangeTree); 269 241 while (pRam) … … 281 253 pRam = pRam->CTX_SUFF(pRight); 282 254 } 283 #else284 for (PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);285 pRam;286 pRam = pRam->CTX_SUFF(pNext))287 {288 RTGCPHYS off = GCPhys - pRam->GCPhys;289 if (off < pRam->cb)290 {291 pVM->pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRam;292 return &pRam->aPages[off >> PAGE_SHIFT];293 }294 }295 #endif296 255 return NULL; 297 256 } … … 307 266 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,RamRangeTlbMisses)); 308 267 309 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES310 268 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangeTree); 311 269 while (pRam) … … 324 282 pRam = pRam->CTX_SUFF(pRight); 325 283 } 326 #else327 for (PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);328 pRam;329 pRam = pRam->CTX_SUFF(pNext))330 {331 RTGCPHYS off = GCPhys - pRam->GCPhys;332 if (off < pRam->cb)333 {334 pVM->pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRam;335 *ppPage = &pRam->aPages[off >> PAGE_SHIFT];336 return VINF_SUCCESS;337 }338 }339 #endif340 284 341 285 *ppPage = NULL; … … 353 297 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,RamRangeTlbMisses)); 354 298 355 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES356 299 PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangeTree); 357 300 while (pRam) … … 371 314 pRam = pRam->CTX_SUFF(pRight); 372 315 } 373 #else374 for (PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);375 pRam;376 pRam = pRam->CTX_SUFF(pNext))377 {378 RTGCPHYS off = GCPhys - pRam->GCPhys;379 if (off < pRam->cb)380 {381 pVM->pgm.s.CTX_SUFF(apRamRangesTlb)[PGM_RAMRANGE_TLB_IDX(GCPhys)] = pRam;382 *ppRam = pRam;383 *ppPage = &pRam->aPages[off >> PAGE_SHIFT];384 return VINF_SUCCESS;385 }386 }387 #endif388 316 389 317 *ppRam = NULL; -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r36960 r37137 578 578 } 579 579 580 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES581 580 582 581 #define MAKE_LEAF(a_pNode) \ … … 720 719 #undef INSERT_LEFT 721 720 #undef INSERT_RIGHT 722 #endif /* PGM_USE_RAMRANGE_SEARCH_TREES */723 721 724 722 /** … … 770 768 ASMAtomicIncU32(&pVM->pgm.s.idRamRangesGen); 771 769 772 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES773 770 pgmR3PhysRebuildRamRangeSearchTrees(pVM); 774 #endif775 771 } 776 772 … … 810 806 ASMAtomicIncU32(&pVM->pgm.s.idRamRangesGen); 811 807 812 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES813 808 pgmR3PhysRebuildRamRangeSearchTrees(pVM); 814 #endif815 809 pgmUnlock(pVM); 816 810 } … … 848 842 ASMAtomicIncU32(&pVM->pgm.s.idRamRangesGen); 849 843 850 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES851 844 pgmR3PhysRebuildRamRangeSearchTrees(pVM); 852 #endif853 845 pgmUnlock(pVM); 854 846 } -
trunk/src/VBox/VMM/include/PGMInternal.h
r36940 r37137 1264 1264 1265 1265 1266 /** Enables the RAM range search trees. */1267 #define PGM_USE_RAMRANGE_SEARCH_TREES1268 1269 1266 /** 1270 1267 * RAM range for GC Phys to HC Phys conversion. … … 1302 1299 RCPTRTYPE(struct PGMRAMRANGE *) pSelfRC; 1303 1300 1304 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES1305 1301 /** Alignment padding. */ 1306 1302 RTRCPTR Alignment0; … … 1317 1313 /** Pointer to the right search three node - raw-mode context. */ 1318 1314 RCPTRTYPE(struct PGMRAMRANGE *) pRightRC; 1319 #endif1320 1315 1321 1316 /** Padding to make aPage aligned on sizeof(PGMPAGE). */ 1322 #ifdef PGM_USE_RAMRANGE_SEARCH_TREES 1323 # if HC_ARCH_BITS == 32 1317 #if HC_ARCH_BITS == 32 1324 1318 uint32_t au32Alignment2[HC_ARCH_BITS == 32 ? 2 : 0]; 1325 # endif1326 #else1327 uint32_t au32Alignment2[HC_ARCH_BITS == 32 ? 1 : 3];1328 1319 #endif 1329 1320 /** Array of physical guest page tracking structures. */
Note:
See TracChangeset
for help on using the changeset viewer.