Changeset 17137 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Feb 25, 2009 4:18:51 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r17135 r17137 4659 4659 /** NOTE: We can't deal with jumps to ring 3 here as we're now in an inconsistent state! */ 4660 4660 # endif 4661 /* Mark the page as locked; disallow flushing. */ 4662 pgmPoolLockPage(pPool, pNewShwPageCR3); 4663 4661 4664 pVM->pgm.s.iShwUser = SHW_POOL_ROOT_IDX; 4662 4665 pVM->pgm.s.iShwUserTable = GCPhysCR3 >> PAGE_SHIFT; … … 4701 4704 if (pOldShwPageCR3) 4702 4705 { 4706 Assert(pOldShwPageCR3->enmKind != PGMPOOLKIND_FREE); 4703 4707 # ifndef PGM_WITHOUT_MAPPINGS 4704 4708 /* Remove the hypervisor mappings from the shadow page table. */ 4705 4709 pgmMapDeactivateCR3(pVM, pOldShwPageCR3); 4706 4710 # endif 4707 /* It might have been freed already by a pool flush (see e.g. PGMR3MappingsUnfix). */4708 /** @todo Coordinate this better with the pool. */4709 if (pOldShwPageCR3->enmKind != PGMPOOLKIND_FREE) 4710 4711 /* Mark the page as unlocked; allow flushing again. */ 4712 pgmPoolUnlockPage(pPool, pOldShwPageCR3); 4713 4714 pgmPoolFreeByPage(pPool, pOldShwPageCR3, iOldShwUser, iOldShwUserTable); 4711 4715 } 4712 4716 … … 4803 4807 { 4804 4808 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 4809 4810 /* Mark the page as unlocked; allow flushing again. */ 4811 pgmPoolUnlockPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 4812 4805 4813 pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), pVM->pgm.s.iShwUser, pVM->pgm.s.iShwUserTable); 4806 4814 pVM->pgm.s.pShwPageCR3R3 = 0; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r17135 r17137 910 910 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 911 911 /** 912 * Checks if the page is the active CR3 or is one of the four PDs of a PAE PDPT913 * 914 * @returns VBox status code (appropriate for GC return).912 * Checks if the page is locked (e.g. the active CR3 or one of the four PDs of a PAE PDPT) 913 * 914 * @returns VBox status code. 915 915 * @param pVM VM Handle. 916 916 * @param pPage PGM pool page 917 917 */ 918 bool pgmPoolIsActiveRootPage(PVM pVM, PPGMPOOLPAGE pPage) 919 { 920 /* First check the simple case. */ 921 if (pPage == pVM->pgm.s.CTX_SUFF(pShwPageCR3)) 922 { 923 LogFlow(("pgmPoolIsActiveRootPage found CR3 root\n")); 918 bool pgmPoolIsPageLocked(PVM pVM, PPGMPOOLPAGE pPage) 919 { 920 if (pPage->fLocked) 921 { 922 LogFlow(("pgmPoolIsPageLocked found root page %s\n", pgmPoolPoolKindToStr(pPage->enmKind))); 924 923 if (pPage->cModifications) 925 924 pPage->cModifications = 1; /* reset counter (can't use 0, or else it will be reinserted in the modified list) */ 926 925 return true; 927 926 } 927 928 #ifdef VBOX_STRICT 929 Assert(pPage != pVM->pgm.s.CTX_SUFF(pShwPageCR3)); 928 930 929 931 # ifndef IN_RING0 … … 946 948 for (unsigned i=0;i<X86_PG_PAE_PDPE_ENTRIES;i++) 947 949 { 948 if ( (pPdpt->a[i].u & PGM_PLXFLAGS_MAPPING) 949 && pPage->Core.Key == (pPdpt->a[i].u & X86_PDPE_PG_MASK)) 950 { 951 Assert(pPdpt->a[i].n.u1Present); 952 LogFlow(("pgmPoolIsActiveRootPage found PAE PDPE root\n")); 953 if (pPage->cModifications) 954 pPage->cModifications = 1; /* reset counter (can't use 0, or else it will be reinserted in the modified list) */ 955 return true; 956 } 950 Assert( !(pPdpt->a[i].u & PGM_PLXFLAGS_MAPPING) 951 || (pPage->Core.Key != (pPdpt->a[i].u & X86_PDPE_PG_MASK))); 957 952 } 958 953 break; … … 964 959 } 965 960 # endif 961 #endif /* VBOX_STRICT */ 966 962 return false; 967 963 } … … 1315 1311 if ( ( pPage->cModifications < 48 /** @todo #define */ /** @todo need to check that it's not mapping EIP. */ /** @todo adjust this! */ 1316 1312 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1317 || pgmPoolIs ActiveRootPage(pVM, pPage)1313 || pgmPoolIsPageLocked(pVM, pPage) 1318 1314 #else 1319 1315 || pPage->fCR3Mix … … 1478 1474 */ 1479 1475 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1480 if (pgmPoolIs ActiveRootPage(pPool->CTX_SUFF(pVM), pPage))1476 if (pgmPoolIsPageLocked(pPool->CTX_SUFF(pVM), pPage)) 1481 1477 #else 1482 1478 if (PGMGetHyperCR3(pPool->CTX_SUFF(pVM)) == pPage->Core.Key) … … 3157 3153 /* Safety precaution in case we change the paging for other modes too in the future. */ 3158 3154 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 3159 Assert(!pgmPoolIs ActiveRootPage(pPool->CTX_SUFF(pVM), pPage));3155 Assert(!pgmPoolIsPageLocked(pPool->CTX_SUFF(pVM), pPage)); 3160 3156 #else 3161 3157 Assert(PGMGetHyperCR3(pPool->CTX_SUFF(pVM)) != pPage->Core.Key); … … 4360 4356 */ 4361 4357 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 4362 if (pgmPoolIs ActiveRootPage(pPool->CTX_SUFF(pVM), pPage))4358 if (pgmPoolIsPageLocked(pPool->CTX_SUFF(pVM), pPage)) 4363 4359 { 4364 4360 AssertMsg( pPage->enmKind == PGMPOOLKIND_64BIT_PML4
Note:
See TracChangeset
for help on using the changeset viewer.