Changeset 6829 in vbox
- Timestamp:
- Feb 6, 2008 2:06:30 PM (17 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r6764 r6829 1548 1548 * Ram ranges. 1549 1549 */ 1550 if (pVM->pgm.s.pRamRangesHC) 1551 { 1552 pVM->pgm.s.pRamRangesGC = MMHyperHC2GC(pVM, pVM->pgm.s.pRamRangesHC); 1553 for (PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesHC; pCur->pNextHC; pCur = pCur->pNextHC) 1550 if (pVM->pgm.s.pRamRangesR3) 1551 { 1552 pVM->pgm.s.pRamRangesGC = MMHyperHC2GC(pVM, pVM->pgm.s.pRamRangesR3); 1553 for (PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesR3; pCur->pNextR3; pCur = pCur->pNextR3) 1554 #ifdef VBOX_WITH_NEW_PHYS_CODE 1555 pCur->pNextGC = MMHyperR3ToGC(pVM, pCur->pNextR3); 1556 #else 1554 1557 { 1555 pCur->pNextGC = MMHyper HC2GC(pVM, pCur->pNextHC);1558 pCur->pNextGC = MMHyperR3ToGC(pVM, pCur->pNextR3); 1556 1559 if (pCur->pavHCChunkGC) 1557 1560 pCur->pavHCChunkGC = MMHyperHC2GC(pVM, pCur->pavHCChunkHC); 1558 1561 } 1562 #endif 1559 1563 } 1560 1564 … … 1686 1690 * Zero memory. 1687 1691 */ 1688 for (PPGMRAMRANGE pRam = pVM->pgm.s.pRamRanges HC; pRam; pRam = pRam->pNextHC)1692 for (PPGMRAMRANGE pRam = pVM->pgm.s.pRamRangesR3; pRam; pRam = pRam->pNextR3) 1689 1693 { 1690 1694 unsigned iPage = pRam->cb >> PAGE_SHIFT; … … 1791 1795 */ 1792 1796 i = 0; 1793 for (PPGMRAMRANGE pRam = pPGM->pRamRanges HC; pRam; pRam = pRam->pNextHC, i++)1797 for (PPGMRAMRANGE pRam = pPGM->pRamRangesR3; pRam; pRam = pRam->pNextR3, i++) 1794 1798 { 1795 1799 /** @todo MMIO ranges may move (PCI reconfig), we currently assume they don't. */ … … 1958 1962 */ 1959 1963 i = 0; 1960 for (PPGMRAMRANGE pRam = pPGM->pRamRanges HC; pRam; pRam = pRam->pNextHC, i++)1964 for (PPGMRAMRANGE pRam = pPGM->pRamRangesR3; pRam; pRam = pRam->pNextR3, i++) 1961 1965 { 1962 1966 /** @todo MMIO ranges may move (PCI reconfig), we currently assume they don't. */ … … 2157 2161 sizeof(RTHCPTR) * 2, "pvHC "); 2158 2162 2159 for (PPGMRAMRANGE pCur = pVM->pgm.s.pRamRanges HC; pCur; pCur = pCur->pNextHC)2163 for (PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesR3; pCur; pCur = pCur->pNextR3) 2160 2164 pHlp->pfnPrintf(pHlp, 2161 "% VGp-%VGp %VHv\n",2165 "%RGp-%RGp %RHv %s\n", 2162 2166 pCur->GCPhys, 2163 2167 pCur->GCPhysLast, 2164 pCur->pvHC); 2168 pCur->pvHC, 2169 pCur->pszDesc); 2165 2170 } 2166 2171 … … 3543 3548 int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "From - To (incl) pvHC\n"); 3544 3549 PPGMRAMRANGE pRam; 3545 for (pRam = pVM->pgm.s.pRamRanges HC; pRam; pRam = pRam->pNextHC)3550 for (pRam = pVM->pgm.s.pRamRangesR3; pRam; pRam = pRam->pNextR3) 3546 3551 { 3547 3552 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, -
trunk/src/VBox/VMM/PGMDbg.cpp
r6528 r6829 56 56 57 57 #else 58 for (PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);58 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 59 59 pRam; 60 pRam = CTX SUFF(pRam->pNext))60 pRam = CTXALLSUFF(pRam->pNext)) 61 61 { 62 62 if (pRam->fFlags & MM_RAM_FLAGS_DYNAMIC_ALLOC) … … 109 109 110 110 #else 111 for (PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);111 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 112 112 pRam; 113 pRam = CTX SUFF(pRam->pNext))113 pRam = CTXALLSUFF(pRam->pNext)) 114 114 { 115 115 if (pRam->fFlags & MM_RAM_FLAGS_DYNAMIC_ALLOC) … … 176 176 return VERR_INVALID_POINTER; 177 177 178 for (PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);178 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 179 179 pRam; 180 pRam = CTX SUFF(pRam->pNext))180 pRam = CTXALLSUFF(pRam->pNext)) 181 181 { 182 182 uint32_t iPage = pRam->cb >> PAGE_SHIFT; … … 342 342 * bother to match across ranges. 343 343 */ 344 for (PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);344 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 345 345 pRam; 346 pRam = CTX SUFF(pRam->pNext))346 pRam = CTXALLSUFF(pRam->pNext)) 347 347 { 348 348 /* -
trunk/src/VBox/VMM/PGMInternal.h
r6820 r6829 647 647 typedef struct PGMRAMRANGE 648 648 { 649 /** Pointer to the next RAM range - for HC. */ 650 R3R0PTRTYPE(struct PGMRAMRANGE *) pNextHC; 649 /** Pointer to the next RAM range - for R3. */ 650 R3PTRTYPE(struct PGMRAMRANGE *) pNextR3; 651 /** Pointer to the next RAM range - for R0. */ 652 R0PTRTYPE(struct PGMRAMRANGE *) pNextR0; 651 653 /** Pointer to the next RAM range - for GC. */ 652 654 GCPTRTYPE(struct PGMRAMRANGE *) pNextGC; … … 659 661 /** MM_RAM_* flags */ 660 662 uint32_t fFlags; 661 663 #ifdef VBOX_WITH_NEW_PHYS_CODE 664 uint32_t u32Alignment; /**< alignment. */ 665 #else 662 666 /** HC virtual lookup ranges for chunks. Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */ 663 667 GCPTRTYPE(PRTHCPTR) pavHCChunkGC; 664 668 /** HC virtual lookup ranges for chunks. Currently only used with MM_RAM_FLAGS_DYNAMIC_ALLOC ranges. */ 665 669 R3R0PTRTYPE(PRTHCPTR) pavHCChunkHC; 666 670 #endif 667 671 /** Start of the HC mapping of the range. 668 672 * For pure MMIO and dynamically allocated ranges this is NULL, while for all ranges this is a valid pointer. */ … … 671 675 R3PTRTYPE(const char *) pszDesc; 672 676 677 #ifdef VBOX_WITH_NEW_PHYS_CODE 673 678 /** Padding to make aPage aligned on sizeof(PGMPAGE). */ 674 RTR3PTR apvReserved[HC_ARCH_BITS == 32 ? 2 : 1]; 679 uint32_t au32Reserved[2]; 680 #else 681 # if HC_ARCH_BITS == 32 682 /** Padding to make aPage aligned on sizeof(PGMPAGE). */ 683 uint32_t u32Reserved; 684 # endif 685 #endif 675 686 676 687 /** Array of physical guest page tracking structures. */ … … 1702 1713 1703 1714 1704 /** Pointer to the list of RAM ranges (Phys GC -> Phys HC conversion) - for HC.1715 /** Pointer to the list of RAM ranges (Phys GC -> Phys HC conversion) - for R3. 1705 1716 * This is sorted by physical address and contains no overlaps. 1706 1717 * The memory locks and other conversions are managed by MM at the moment. 1707 1718 */ 1708 R3R0PTRTYPE(PPGMRAMRANGE) pRamRangesHC; 1709 /** Pointer to the list of RAM ranges (Phys GC -> Phys HC conversion) - for GC. 1710 * This is sorted by physical address and contains no overlaps. 1711 * The memory locks and other conversions are managed by MM at the moment. 1712 */ 1719 R3PTRTYPE(PPGMRAMRANGE) pRamRangesR3; 1720 /** R0 pointer corresponding to PGM::pRamRangesR3. */ 1721 R0PTRTYPE(PPGMRAMRANGE) pRamRangesR0; 1722 /** GC pointer corresponding to PGM::pRamRangesR3. */ 1713 1723 GCPTRTYPE(PPGMRAMRANGE) pRamRangesGC; 1714 1724 /** The configured RAM size. */ … … 2255 2265 * Optimize for the first range. 2256 2266 */ 2257 PPGMRAMRANGE pRam = CTX SUFF(pPGM->pRamRanges);2267 PPGMRAMRANGE pRam = CTXALLSUFF(pPGM->pRamRanges); 2258 2268 RTGCPHYS off = GCPhys - pRam->GCPhys; 2259 2269 if (RT_UNLIKELY(off >= pRam->cb)) … … 2261 2271 do 2262 2272 { 2263 pRam = CTX SUFF(pRam->pNext);2273 pRam = CTXALLSUFF(pRam->pNext); 2264 2274 if (RT_UNLIKELY(!pRam)) 2265 2275 return NULL; … … 2289 2299 * Optimize for the first range. 2290 2300 */ 2291 PPGMRAMRANGE pRam = CTX SUFF(pPGM->pRamRanges);2301 PPGMRAMRANGE pRam = CTXALLSUFF(pPGM->pRamRanges); 2292 2302 RTGCPHYS off = GCPhys - pRam->GCPhys; 2293 2303 if (RT_UNLIKELY(off >= pRam->cb)) … … 2295 2305 do 2296 2306 { 2297 pRam = CTX SUFF(pRam->pNext);2307 pRam = CTXALLSUFF(pRam->pNext); 2298 2308 if (RT_UNLIKELY(!pRam)) 2299 2309 { … … 2354 2364 || RT_UNLIKELY((off = GCPhys - pRam->GCPhys) >= pRam->cb)) 2355 2365 { 2356 pRam = CTX SUFF(pPGM->pRamRanges);2366 pRam = CTXALLSUFF(pPGM->pRamRanges); 2357 2367 off = GCPhys - pRam->GCPhys; 2358 2368 if (RT_UNLIKELY(off >= pRam->cb)) … … 2360 2370 do 2361 2371 { 2362 pRam = CTX SUFF(pRam->pNext);2372 pRam = CTXALLSUFF(pRam->pNext); 2363 2373 if (RT_UNLIKELY(!pRam)) 2364 2374 { … … 2412 2422 * Optimize for the first range. 2413 2423 */ 2414 PPGMRAMRANGE pRam = CTX SUFF(pPGM->pRamRanges);2424 PPGMRAMRANGE pRam = CTXALLSUFF(pPGM->pRamRanges); 2415 2425 RTGCPHYS off = GCPhys - pRam->GCPhys; 2416 2426 if (RT_UNLIKELY(off >= pRam->cb)) … … 2418 2428 do 2419 2429 { 2420 pRam = CTX SUFF(pRam->pNext);2430 pRam = CTXALLSUFF(pRam->pNext); 2421 2431 if (RT_UNLIKELY(!pRam)) 2422 2432 return NULL; … … 2447 2457 * Optimize for the first range. 2448 2458 */ 2449 PPGMRAMRANGE pRam = CTX SUFF(pPGM->pRamRanges);2459 PPGMRAMRANGE pRam = CTXALLSUFF(pPGM->pRamRanges); 2450 2460 RTGCPHYS off = GCPhys - pRam->GCPhys; 2451 2461 if (RT_UNLIKELY(off >= pRam->cb)) … … 2453 2463 do 2454 2464 { 2455 pRam = CTX SUFF(pRam->pNext);2465 pRam = CTXALLSUFF(pRam->pNext); 2456 2466 if (RT_UNLIKELY(!pRam)) 2457 2467 { -
trunk/src/VBox/VMM/PGMPhys.cpp
r6820 r6829 101 101 */ 102 102 PPGMRAMRANGE pPrev = NULL; 103 PPGMRAMRANGE pCur = pVM->pgm.s.pRamRanges HC;103 PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesR3; 104 104 while (pCur && GCPhysLast >= pCur->GCPhys) 105 105 { … … 113 113 /* next */ 114 114 pPrev = pCur; 115 pCur = pCur->pNext HC;115 pCur = pCur->pNextR3; 116 116 } 117 117 … … 161 161 */ 162 162 pgmLock(pVM); 163 pNew->pNext HC= pCur;164 //pNew->pNextR0 = pCur ? MMHyperCCToR0(pVM, pCur) : NIL_RTR0PTR;163 pNew->pNextR3 = pCur; 164 pNew->pNextR0 = pCur ? MMHyperCCToR0(pVM, pCur) : NIL_RTR0PTR; 165 165 pNew->pNextGC = pCur ? MMHyperCCToGC(pVM, pCur) : NIL_RTGCPTR; 166 166 if (pPrev) 167 167 { 168 pPrev->pNext HC= pNew;169 //pPrev->pNextR0 = MMHyperCCToR0(pVM, pNew);168 pPrev->pNextR3 = pNew; 169 pPrev->pNextR0 = MMHyperCCToR0(pVM, pNew); 170 170 pPrev->pNextGC = MMHyperCCToGC(pVM, pNew); 171 171 } 172 172 else 173 173 { 174 pVM->pgm.s.pRamRanges HC= pNew;175 //pVM->pgm.s.pRamRangesR0 = MMHyperCCToR0(pVM, pNew);174 pVM->pgm.s.pRamRangesR3 = pNew; 175 pVM->pgm.s.pRamRangesR0 = MMHyperCCToR0(pVM, pNew); 176 176 pVM->pgm.s.pRamRangesGC = MMHyperCCToGC(pVM, pNew); 177 177 } … … 229 229 */ 230 230 PPGMRAMRANGE pPrev = NULL; 231 PPGMRAMRANGE pCur = pVM->pgm.s.pRamRanges HC;231 PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesR3; 232 232 while (pCur) 233 233 { … … 242 242 /* next */ 243 243 pPrev = pCur; 244 pCur = pCur->pNext HC;244 pCur = pCur->pNextR3; 245 245 } 246 246 … … 349 349 */ 350 350 pgmLock(pVM); 351 pNew->pNextHC = pCur; 352 pNew->pNextGC = pCur ? MMHyperHC2GC(pVM, pCur) : 0; 351 pNew->pNextR3 = pCur; 352 pNew->pNextR0 = pCur ? MMHyperCCToR0(pVM, pCur) : NIL_RTR0PTR; 353 pNew->pNextGC = pCur ? MMHyperCCToGC(pVM, pCur) : NIL_RTGCPTR; 353 354 if (pPrev) 354 355 { 355 pPrev->pNextHC = pNew; 356 pPrev->pNextR3 = pNew; 357 pPrev->pNextR0 = MMHyperCCToR0(pVM, pNew); 356 358 pPrev->pNextGC = GCPtrNew; 357 359 } 358 360 else 359 361 { 360 pVM->pgm.s.pRamRangesHC = pNew; 362 pVM->pgm.s.pRamRangesR3 = pNew; 363 pVM->pgm.s.pRamRangesR0 = MMHyperCCToR0(pVM, pNew); 361 364 pVM->pgm.s.pRamRangesGC = GCPtrNew; 362 365 } … … 415 418 * Find existing range location. 416 419 */ 417 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);420 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 418 421 while (pRam) 419 422 { … … 423 426 break; 424 427 425 pRam = CTX SUFF(pRam->pNext);428 pRam = CTXALLSUFF(pRam->pNext); 426 429 } 427 430 AssertReturn(pRam, VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS); … … 458 461 pgmLock(pVM); 459 462 460 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);463 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 461 464 while (pRam) 462 465 { … … 478 481 } 479 482 480 pRam = CTX SUFF(pRam->pNext);483 pRam = CTXALLSUFF(pRam->pNext); 481 484 } 482 485 pgmUnlock(pVM); … … 605 608 pgmLock(pVM); 606 609 PPGMRAMRANGE pPrev = NULL; 607 PPGMRAMRANGE pCur = pVM->pgm.s.pRamRanges HC;610 PPGMRAMRANGE pCur = pVM->pgm.s.pRamRangesR3; 608 611 while (pCur) 609 612 { … … 613 616 /* next */ 614 617 pPrev = pCur; 615 pCur = pCur->pNext HC;618 pCur = pCur->pNextR3; 616 619 } 617 620 if (pPrev) 618 621 { 619 pPrev->pNextHC = pCur->pNextHC; 622 pPrev->pNextR3 = pCur->pNextR3; 623 pPrev->pNextR0 = pCur->pNextR0; 620 624 pPrev->pNextGC = pCur->pNextGC; 621 625 } 622 626 else 623 627 { 624 pVM->pgm.s.pRamRangesHC = pCur->pNextHC; 628 pVM->pgm.s.pRamRangesR3 = pCur->pNextR3; 629 pVM->pgm.s.pRamRangesR0 = pCur->pNextR0; 625 630 pVM->pgm.s.pRamRangesGC = pCur->pNextGC; 626 631 } … … 637 642 */ 638 643 pPrev = NULL; 639 pCur = pVM->pgm.s.pRamRanges HC;644 pCur = pVM->pgm.s.pRamRangesR3; 640 645 while (pCur) 641 646 { … … 651 656 /* next */ 652 657 pPrev = pCur; 653 pCur = pCur->pNext HC;658 pCur = pCur->pNextR3; 654 659 } 655 660 … … 657 662 * Reinsert the RAM range. 658 663 */ 659 pNew->pNextHC = pCur; 660 pNew->pNextGC = pCur ? MMHyperHC2GC(pVM, pCur) : 0; 664 pNew->pNextR3 = pCur; 665 pNew->pNextR0 = pCur ? MMHyperCCToR0(pVM, pCur) : 0; 666 pNew->pNextGC = pCur ? MMHyperCCToGC(pVM, pCur) : 0; 661 667 if (pPrev) 662 668 { 663 pPrev->pNextHC = pNew; 664 pPrev->pNextGC = MMHyperHC2GC(pVM, pNew); 669 pPrev->pNextR3 = pNew; 670 pPrev->pNextR0 = MMHyperCCToR0(pVM, pNew); 671 pPrev->pNextGC = MMHyperCCToGC(pVM, pNew); 665 672 } 666 673 else 667 674 { 668 pVM->pgm.s.pRamRangesHC = pNew; 669 pVM->pgm.s.pRamRangesGC = MMHyperHC2GC(pVM, pNew); 675 pVM->pgm.s.pRamRangesR3 = pNew; 676 pVM->pgm.s.pRamRangesR0 = MMHyperCCToR0(pVM, pNew); 677 pVM->pgm.s.pRamRangesGC = MMHyperCCToGC(pVM, pNew); 670 678 } 671 679 … … 703 711 * Lookup the range. 704 712 */ 705 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);713 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 706 714 while (pRam && GCPhys > pRam->GCPhysLast) 707 pRam = CTX SUFF(pRam->pNext);715 pRam = CTXALLSUFF(pRam->pNext); 708 716 if ( !pRam 709 717 || GCPhys > pRam->GCPhysLast -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r5999 r6829 1571 1571 * Check the RAM flags against the handlers. 1572 1572 */ 1573 for (PPGMRAMRANGE pRam = CTX SUFF(pPGM->pRamRanges); pRam; pRam = CTXSUFF(pRam->pNext))1573 for (PPGMRAMRANGE pRam = CTXALLSUFF(pPGM->pRamRanges); pRam; pRam = CTXALLSUFF(pRam->pNext)) 1574 1574 { 1575 1575 const unsigned cPages = pRam->cb >> PAGE_SHIFT; -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r5999 r6829 1091 1091 * Find the guest address. 1092 1092 */ 1093 for (PPGMRAMRANGE pRam = pVM->pgm.s.CTXSUFF(pRamRanges);1093 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 1094 1094 pRam; 1095 pRam = pRam->CTXSUFF(pNext))1095 pRam = CTXALLSUFF(pRam->pNext)) 1096 1096 { 1097 1097 unsigned iPage = pRam->cb >> PAGE_SHIFT; … … 2163 2163 GCPtrPage, PdeSrc.b.u1Present, PdeSrc.b.u1Write, PdeSrc.b.u1User, (uint64_t)PdeSrc.u, GCPtr, 2164 2164 GCPhys, PdeDst.u & PGM_PDFLAGS_TRACK_DIRTY ? " Track-Dirty" : "")); 2165 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);2165 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 2166 2166 unsigned iPTDst = 0; 2167 2167 while (iPTDst < ELEMENTS(pPTDst->a)) … … 2169 2169 /* Advance ram range list. */ 2170 2170 while (pRam && GCPhys > pRam->GCPhysLast) 2171 pRam = CTX SUFF(pRam->pNext);2171 pRam = CTXALLSUFF(pRam->pNext); 2172 2172 if (pRam && GCPhys >= pRam->GCPhys) 2173 2173 { -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r5999 r6829 115 115 * There is no apparent need to support ranges which cover more than one ram range. 116 116 */ 117 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);117 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 118 118 while (pRam && GCPhys > pRam->GCPhysLast) 119 pRam = CTX SUFF(pRam->pNext);119 pRam = CTXALLSUFF(pRam->pNext); 120 120 if ( !pRam 121 121 || GCPhysLast < pRam->GCPhys … … 138 138 139 139 /* search again. */ 140 pRam = CTX SUFF(pVM->pgm.s.pRamRanges);140 pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 141 141 while (pRam && GCPhys > pRam->GCPhysLast) 142 pRam = CTX SUFF(pRam->pNext);142 pRam = CTXALLSUFF(pRam->pNext); 143 143 } 144 144 … … 505 505 * There is no apparent need to support ranges which cover more than one ram range. 506 506 */ 507 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);507 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 508 508 while (pRam && GCPhys > pRam->GCPhysLast) 509 pRam = CTX SUFF(pRam->pNext);509 pRam = CTXALLSUFF(pRam->pNext); 510 510 if ( pRam 511 511 && GCPhys <= pRam->GCPhysLast … … 797 797 */ 798 798 STAM_COUNTER_INC(&pVM->pgm.s.StatHandlePhysicalReset); 799 PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);799 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 800 800 while (pRam && GCPhys > pRam->GCPhysLast) 801 pRam = CTX SUFF(pRam->pNext);801 pRam = CTXALLSUFF(pRam->pNext); 802 802 int rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pCur, pRam); 803 803 if (rc == VINF_PGM_GCPHYS_ALIASED) -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r6532 r6829 476 476 * 99.8% of requests are expected to be in the first range. 477 477 */ 478 PPGMRAMRANGE pRam = CTX SUFF(pPGM->pRamRanges);478 PPGMRAMRANGE pRam = CTXALLSUFF(pPGM->pRamRanges); 479 479 RTGCPHYS off = GCPhys - pRam->GCPhys; 480 480 if (RT_UNLIKELY(off >= pRam->cb)) … … 482 482 do 483 483 { 484 pRam = CTX SUFF(pRam->pNext);484 pRam = CTXALLSUFF(pRam->pNext); 485 485 if (!pRam) 486 486 return VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS; … … 1028 1028 * Copy loop on ram ranges. 1029 1029 */ 1030 PPGMRAMRANGE pCur = CTXSUFF(pVM->pgm.s.pRamRanges);1030 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 1031 1031 for (;;) 1032 1032 { 1033 1033 /* Find range. */ 1034 while (p Cur && GCPhys > pCur->GCPhysLast)1035 p Cur = CTXSUFF(pCur->pNext);1034 while (pRam && GCPhys > pRam->GCPhysLast) 1035 pRam = CTXALLSUFF(pRam->pNext); 1036 1036 /* Inside range or not? */ 1037 if (p Cur && GCPhys >= pCur->GCPhys)1037 if (pRam && GCPhys >= pRam->GCPhys) 1038 1038 { 1039 1039 /* 1040 1040 * Must work our way thru this page by page. 1041 1041 */ 1042 RTGCPHYS off = GCPhys - p Cur->GCPhys;1043 while (off < p Cur->cb)1042 RTGCPHYS off = GCPhys - pRam->GCPhys; 1043 while (off < pRam->cb) 1044 1044 { 1045 1045 unsigned iPage = off >> PAGE_SHIFT; 1046 PPGMPAGE pPage = &p Cur->aPages[iPage];1046 PPGMPAGE pPage = &pRam->aPages[iPage]; 1047 1047 size_t cb; 1048 1048 … … 1079 1079 pvSrc = (char *)pvSrc + (off & PAGE_OFFSET_MASK); 1080 1080 #else 1081 void *pvSrc = PGMRAMRANGE_GETHCPTR(p Cur, off)1081 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1082 1082 #endif 1083 1083 cb = PAGE_SIZE - (off & PAGE_OFFSET_MASK); … … 1128 1128 cb = cbRead; 1129 1129 1130 void *pvSrc = PGMRAMRANGE_GETHCPTR(p Cur, off)1130 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1131 1131 1132 1132 /** @note Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ … … 1141 1141 pvSrc = (char *)pvSrc + (off & PAGE_OFFSET_MASK); 1142 1142 #else 1143 void *pvSrc = PGMRAMRANGE_GETHCPTR(p Cur, off)1143 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1144 1144 #endif 1145 1145 … … 1175 1175 + (iPage << PAGE_SHIFT) + (off & PAGE_OFFSET_MASK); 1176 1176 1177 void *pvSrc = PGMRAMRANGE_GETHCPTR(p Cur, off)1177 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1178 1178 1179 1179 /** @note Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ … … 1188 1188 pvSrc = (char *)pvSrc + (off & PAGE_OFFSET_MASK); 1189 1189 #else 1190 void *pvSrc = PGMRAMRANGE_GETHCPTR(p Cur, off)1190 void *pvSrc = PGMRAMRANGE_GETHCPTR(pRam, off) 1191 1191 #endif 1192 1192 if (cb >= cbRead) … … 1225 1225 } 1226 1226 1227 GCPhys = p Cur->GCPhysLast + 1;1227 GCPhys = pRam->GCPhysLast + 1; 1228 1228 } 1229 1229 else … … 1235 1235 */ 1236 1236 size_t cb; 1237 if ( !p Cur1238 || (cb = p Cur->GCPhys - GCPhys) >= cbRead)1237 if ( !pRam 1238 || (cb = pRam->GCPhys - GCPhys) >= cbRead) 1239 1239 { 1240 1240 memset(pvBuf, 0, cbRead); … … 1290 1290 * Copy loop on ram ranges. 1291 1291 */ 1292 PPGMRAMRANGE p Cur = CTXSUFF(pVM->pgm.s.pRamRanges);1292 PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 1293 1293 for (;;) 1294 1294 { 1295 1295 /* Find range. */ 1296 while (p Cur && GCPhys > pCur->GCPhysLast)1297 p Cur = CTXSUFF(pCur->pNext);1296 while (pRam && GCPhys > pRam->GCPhysLast) 1297 pRam = CTXALLSUFF(pRam->pNext); 1298 1298 /* Inside range or not? */ 1299 if (p Cur && GCPhys >= pCur->GCPhys)1299 if (pRam && GCPhys >= pRam->GCPhys) 1300 1300 { 1301 1301 /* 1302 1302 * Must work our way thru this page by page. 1303 1303 */ 1304 unsigned off = GCPhys - p Cur->GCPhys;1305 while (off < p Cur->cb)1304 unsigned off = GCPhys - pRam->GCPhys; 1305 while (off < pRam->cb) 1306 1306 { 1307 1307 unsigned iPage = off >> PAGE_SHIFT; 1308 PPGMPAGE pPage = &p Cur->aPages[iPage];1308 PPGMPAGE pPage = &pRam->aPages[iPage]; 1309 1309 1310 1310 /* Physical chunk in dynamically allocated range not present? */ … … 1318 1318 rc = pgmr3PhysGrowRange(pVM, GCPhys); 1319 1319 if (rc == VINF_SUCCESS) 1320 PGMPhysWrite(pVM, GCPhys, pvBuf, cbWrite); /* try again; can't assume p Curis still valid (paranoia) */1320 PGMPhysWrite(pVM, GCPhys, pvBuf, cbWrite); /* try again; can't assume pRam is still valid (paranoia) */ 1321 1321 return; 1322 1322 } … … 1345 1345 pvDst = (char *)pvDst + (off & PAGE_OFFSET_MASK); 1346 1346 #else 1347 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1347 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1348 1348 #endif 1349 1349 cb = PAGE_SIZE - (off & PAGE_OFFSET_MASK); … … 1392 1392 cb = cbWrite; 1393 1393 1394 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1394 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1395 1395 1396 1396 /** @note Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ … … 1405 1405 pvDst = (char *)pvDst + (off & PAGE_OFFSET_MASK); 1406 1406 #else 1407 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1407 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1408 1408 #endif 1409 1409 if (cb >= cbWrite) … … 1440 1440 + (iPage << PAGE_SHIFT) + (off & PAGE_OFFSET_MASK); 1441 1441 1442 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1442 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1443 1443 1444 1444 /** @note Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ … … 1453 1453 pvDst = (char *)pvDst + (off & PAGE_OFFSET_MASK); 1454 1454 #else 1455 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1455 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1456 1456 #endif 1457 1457 if (cb >= cbWrite) … … 1489 1489 cb = cbWrite; 1490 1490 1491 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1491 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1492 1492 1493 1493 /** @note Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ … … 1509 1509 + (iPage << PAGE_SHIFT) + (off & PAGE_OFFSET_MASK); 1510 1510 1511 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1511 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1512 1512 1513 1513 /** @note Dangerous assumption that HC handlers don't do anything that really requires an EMT lock! */ … … 1527 1527 pvDst = (char *)pvDst + (off & PAGE_OFFSET_MASK); 1528 1528 #else 1529 void *pvDst = PGMRAMRANGE_GETHCPTR(p Cur, off)1529 void *pvDst = PGMRAMRANGE_GETHCPTR(pRam, off) 1530 1530 #endif 1531 1531 if (cb >= cbWrite) … … 1566 1566 } 1567 1567 1568 GCPhys = p Cur->GCPhysLast + 1;1568 GCPhys = pRam->GCPhysLast + 1; 1569 1569 } 1570 1570 else … … 1574 1574 */ 1575 1575 size_t cb; 1576 if ( !p Cur1577 || (cb = p Cur->GCPhys - GCPhys) >= cbWrite)1576 if ( !pRam 1577 || (cb = pRam->GCPhys - GCPhys) >= cbWrite) 1578 1578 goto end; 1579 1579 … … 1614 1614 * Loop ram ranges. 1615 1615 */ 1616 for (PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);1616 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 1617 1617 pRam; 1618 pRam = pRam->CTXSUFF(pNext))1618 pRam = CTXALLSUFF(pRam->pNext)) 1619 1619 { 1620 1620 RTGCPHYS off = GCPhysSrc - pRam->GCPhys; … … 1698 1698 * Loop ram ranges. 1699 1699 */ 1700 for (PPGMRAMRANGE pRam = CTX SUFF(pVM->pgm.s.pRamRanges);1700 for (PPGMRAMRANGE pRam = CTXALLSUFF(pVM->pgm.s.pRamRanges); 1701 1701 pRam; 1702 pRam = pRam->CTXSUFF(pNext))1702 pRam = CTXALLSUFF(pRam->pNext)) 1703 1703 { 1704 1704 RTGCPHYS off = GCPhysDst - pRam->GCPhys; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r5999 r6829 754 754 * Not worth it, so flush it. 755 755 * 756 * If we considered it to be reused, don't to back to ring-3 757 * to emulate failed instructions since we usually cannot 756 * If we considered it to be reused, don't to back to ring-3 757 * to emulate failed instructions since we usually cannot 758 758 * interpret then. This may be a bit risky, in which case 759 759 * the reuse detection must be fixed. … … 1631 1631 * Clear all the GCPhys links and rebuild the phys ext free list. 1632 1632 */ 1633 for (PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTX SUFF(pRamRanges);1633 for (PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXALLSUFF(pRamRanges); 1634 1634 pRam; 1635 pRam = pRam->CTXSUFF(pNext))1635 pRam = CTXALLSUFF(pRam->pNext)) 1636 1636 { 1637 1637 unsigned iPage = pRam->cb >> PAGE_SHIFT; … … 2625 2625 * Walk range list. 2626 2626 */ 2627 PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTX SUFF(pRamRanges);2627 PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXALLSUFF(pRamRanges); 2628 2628 while (pRam) 2629 2629 { … … 2641 2641 break; 2642 2642 } 2643 pRam = CTX SUFF(pRam->pNext);2643 pRam = CTXALLSUFF(pRam->pNext); 2644 2644 } 2645 2645 AssertFatalMsgFailed(("HCPhys=%VHp GCPhys=%VGp\n", HCPhys, GCPhys)); … … 2660 2660 * Walk range list. 2661 2661 */ 2662 PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTX SUFF(pRamRanges);2662 PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXALLSUFF(pRamRanges); 2663 2663 while (pRam) 2664 2664 { … … 2676 2676 break; 2677 2677 } 2678 pRam = CTX SUFF(pRam->pNext);2678 pRam = CTXALLSUFF(pRam->pNext); 2679 2679 } 2680 2680 … … 2683 2683 */ 2684 2684 STAM_COUNTER_INC(&pPool->StatTrackLinearRamSearches); 2685 pRam = pPool->CTXSUFF(pVM)->pgm.s.CTX SUFF(pRamRanges);2685 pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXALLSUFF(pRamRanges); 2686 2686 while (pRam) 2687 2687 { … … 2697 2697 } 2698 2698 } 2699 pRam = CTX SUFF(pRam->pNext);2699 pRam = CTXALLSUFF(pRam->pNext); 2700 2700 } 2701 2701 … … 3097 3097 * Clear all the GCPhys links and rebuild the phys ext free list. 3098 3098 */ 3099 for (PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTX SUFF(pRamRanges);3099 for (PPGMRAMRANGE pRam = pPool->CTXSUFF(pVM)->pgm.s.CTXALLSUFF(pRamRanges); 3100 3100 pRam; 3101 pRam = pRam->CTXSUFF(pNext))3101 pRam = CTXALLSUFF(pRam->pNext)) 3102 3102 { 3103 3103 unsigned iPage = pRam->cb >> PAGE_SHIFT; -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r6820 r6829 420 420 GEN_CHECK_OFF(PGM, pfnGCBthVerifyAccessSyncPage); 421 421 GEN_CHECK_OFF(PGM, pfnGCBthAssertCR3); 422 GEN_CHECK_OFF(PGM, pRamRangesHC); 422 GEN_CHECK_OFF(PGM, pRamRangesR3); 423 GEN_CHECK_OFF(PGM, pRamRangesR0); 423 424 GEN_CHECK_OFF(PGM, pRamRangesGC); 424 425 GEN_CHECK_OFF(PGM, cbRamSize); … … 531 532 GEN_CHECK_OFF(PGMPAGE, HCPhys); 532 533 GEN_CHECK_SIZE(PGMRAMRANGE); 533 GEN_CHECK_OFF(PGMRAMRANGE, pNextHC); 534 GEN_CHECK_OFF(PGMRAMRANGE, pNextR3); 535 GEN_CHECK_OFF(PGMRAMRANGE, pNextR0); 534 536 GEN_CHECK_OFF(PGMRAMRANGE, pNextGC); 535 537 GEN_CHECK_OFF(PGMRAMRANGE, GCPhys);
Note:
See TracChangeset
for help on using the changeset viewer.