- Timestamp:
- May 28, 2012 10:36:04 AM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r41391 r41458 978 978 979 979 /* Create a reference back to the PDPT by using the index in its shadow page. */ 980 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage); 980 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 981 pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, false /*fLockPage*/, 982 &pShwPage); 981 983 AssertRCReturn(rc, rc); 982 984 … … 1090 1092 1091 1093 /* Create a reference back to the PDPT by using the index in its shadow page. */ 1092 rc = pgmPoolAlloc(pVM, GCPml4, enmKind, pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage); 1094 rc = pgmPoolAlloc(pVM, GCPml4, enmKind, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 1095 pVCpu->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, false /*fLockPage*/, 1096 &pShwPage); 1093 1097 AssertRCReturn(rc, rc); 1094 1098 } … … 1127 1131 1128 1132 /* Create a reference back to the PDPT by using the index in its shadow page. */ 1129 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pShwPage->idx, iPdPt, &pShwPage); 1133 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 1134 pShwPage->idx, iPdPt, false /*fLockPage*/, 1135 &pShwPage); 1130 1136 AssertRCReturn(rc, rc); 1131 1137 } … … 1223 1229 RTGCPTR64 GCPml4 = (RTGCPTR64)iPml4 << EPT_PML4_SHIFT; 1224 1230 1225 rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage); 1231 rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 1232 PGMPOOL_IDX_NESTED_ROOT, iPml4, false /*fLockPage*/, 1233 &pShwPage); 1226 1234 AssertRCReturn(rc, rc); 1227 1235 } … … 1251 1259 { 1252 1260 RTGCPTR64 GCPdPt = (RTGCPTR64)iPdPt << EPT_PDPT_SHIFT; 1253 1254 rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_EPT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage); 1261 rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_EPT_PD_FOR_PHYS, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 1262 pShwPage->idx, iPdPt, false /*fLockPage*/, 1263 &pShwPage); 1255 1264 AssertRCReturn(rc, rc); 1256 1265 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r41456 r41458 2679 2679 GCPhys = PGM_A20_APPLY(pVCpu, GCPhys | ((iPDDst & 1) * (PAGE_SIZE / 2))); 2680 2680 # endif 2681 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx, iPDDst, &pShwPage); 2681 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 2682 pShwPde->idx, iPDDst, false /*fLockPage*/, 2683 &pShwPage); 2682 2684 } 2683 2685 else … … 2710 2712 enmAccess = (fNoExecute) ? PGMPOOLACCESS_SUPERVISOR_R_NX : PGMPOOLACCESS_SUPERVISOR_R; 2711 2713 } 2712 rc = pgmPoolAllocEx(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_BIG, enmAccess, pShwPde->idx, iPDDst, false /*fLockPage*/, 2713 &pShwPage); 2714 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_BIG, enmAccess, PGM_A20_IS_ENABLED(pVCpu), 2715 pShwPde->idx, iPDDst, false /*fLockPage*/, 2716 &pShwPage); 2714 2717 } 2715 2718 if (rc == VINF_SUCCESS) … … 3186 3189 /* Virtual address = physical address */ 3187 3190 GCPhys = PGM_A20_APPLY(pVCpu, GCPtrPage & X86_PAGE_4K_BASE_MASK); 3188 rc = pgmPoolAlloc(pVM, GCPhys & ~(RT_BIT_64(SHW_PD_SHIFT) - 1), BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx, iPDDst, &pShwPage); 3189 3191 rc = pgmPoolAlloc(pVM, GCPhys & ~(RT_BIT_64(SHW_PD_SHIFT) - 1), BTH_PGMPOOLKIND_PT_FOR_PT, PGMPOOLACCESS_DONTCARE, 3192 PGM_A20_IS_ENABLED(pVCpu), pShwPde->idx, iPDDst, false /*fLockPage*/, 3193 &pShwPage); 3190 3194 if ( rc == VINF_SUCCESS 3191 3195 || rc == VINF_PGM_CACHED_PAGE) … … 4596 4600 4597 4601 Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32))); 4598 rc = pgmPoolAllocEx(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, PGMPOOLACCESS_DONTCARE, SHW_POOL_ROOT_IDX, 4599 GCPhysCR3 >> PAGE_SHIFT, true /*fLockPage*/, &pNewShwPageCR3); 4602 rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 4603 SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, true /*fLockPage*/, 4604 &pNewShwPageCR3); 4600 4605 AssertFatalRC(rc); 4601 4606 rc = VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r41456 r41458 2167 2167 * @param enmKind The kind of mapping. 2168 2168 * @param enmAccess Access type for the mapping (only relevant for big pages) 2169 * @param fA20Enabled Whether the CPU has the A20 gate enabled. 2169 2170 * @param iUser The shadow page pool index of the user table. 2170 2171 * @param iUserTable The index into the user table (shadowed). 2171 2172 * @param ppPage Where to store the pointer to the page. 2172 2173 */ 2173 static int pgmPoolCacheAlloc(PPGMPOOL pPool, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, uint32_t iUserTable, PPPGMPOOLPAGE ppPage) 2174 static int pgmPoolCacheAlloc(PPGMPOOL pPool, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, bool fA20Enabled, 2175 uint16_t iUser, uint32_t iUserTable, PPPGMPOOLPAGE ppPage) 2174 2176 { 2175 2177 /* … … 2186 2188 if (pPage->GCPhys == GCPhys) 2187 2189 { 2188 if ( (PGMPOOLKIND)pPage->enmKind == enmKind 2189 && (PGMPOOLACCESS)pPage->enmAccess == enmAccess) 2190 if ( (PGMPOOLKIND)pPage->enmKind == enmKind 2191 && (PGMPOOLACCESS)pPage->enmAccess == enmAccess 2192 #if 0 2193 && pPage->fA20Enabled == fA20Enabled 2194 #endif 2195 ) 2190 2196 { 2191 2197 /* Put it at the start of the use list to make sure pgmPoolTrackAddUser … … 4961 4967 * @param enmKind The kind of mapping. 4962 4968 * @param enmAccess Access type for the mapping (only relevant for big pages) 4969 * @param fA20Enabled Whether the A20 gate is enabled or not. 4963 4970 * @param iUser The shadow page pool index of the user table. 4964 4971 * @param iUserTable The index into the user table (shadowed). … … 4966 4973 * @param ppPage Where to store the pointer to the page. NULL is stored here on failure. 4967 4974 */ 4968 int pgmPoolAlloc Ex(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, uint32_t iUserTable,4969 4975 int pgmPoolAlloc(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, bool fA20Enabled, 4976 uint16_t iUser, uint32_t iUserTable, bool fLockPage, PPPGMPOOLPAGE ppPage) 4970 4977 { 4971 4978 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 4972 4979 STAM_PROFILE_ADV_START(&pPool->StatAlloc, a); 4973 LogFlow(("pgmPoolAlloc Ex: GCPhys=%RGp enmKind=%s iUser=%d iUserTable=%#x\n", GCPhys, pgmPoolPoolKindToStr(enmKind), iUser, iUserTable));4980 LogFlow(("pgmPoolAlloc: GCPhys=%RGp enmKind=%s iUser=%d iUserTable=%#x\n", GCPhys, pgmPoolPoolKindToStr(enmKind), iUser, iUserTable)); 4974 4981 *ppPage = NULL; 4975 4982 /** @todo CSAM/PGMPrefetchPage messes up here during CSAMR3CheckGates … … 4981 4988 if (pPool->fCacheEnabled) 4982 4989 { 4983 int rc2 = pgmPoolCacheAlloc(pPool, GCPhys, enmKind, enmAccess, iUser, iUserTable, ppPage);4990 int rc2 = pgmPoolCacheAlloc(pPool, GCPhys, enmKind, enmAccess, fA20Enabled, iUser, iUserTable, ppPage); 4984 4991 if (RT_SUCCESS(rc2)) 4985 4992 { … … 4988 4995 pgmUnlock(pVM); 4989 4996 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 4990 LogFlow(("pgmPoolAlloc Ex: cached returns %Rrc *ppPage=%p:{.Key=%RHp, .idx=%d}\n", rc2, *ppPage, (*ppPage)->Core.Key, (*ppPage)->idx));4997 LogFlow(("pgmPoolAlloc: cached returns %Rrc *ppPage=%p:{.Key=%RHp, .idx=%d}\n", rc2, *ppPage, (*ppPage)->Core.Key, (*ppPage)->idx)); 4991 4998 return rc2; 4992 4999 } … … 5004 5011 { 5005 5012 pgmUnlock(pVM); 5006 Log(("pgmPoolAlloc Ex: returns %Rrc (Free)\n", rc));5013 Log(("pgmPoolAlloc: returns %Rrc (Free)\n", rc)); 5007 5014 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 5008 5015 return rc; … … 5024 5031 pPage->enmAccess = enmAccess; 5025 5032 pPage->GCPhys = GCPhys; 5033 pPage->fA20Enabled = fA20Enabled; 5026 5034 pPage->fSeenNonGlobal = false; /* Set this to 'true' to disable this feature. */ 5027 5035 pPage->fMonitored = false; … … 5057 5065 pgmUnlock(pVM); 5058 5066 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 5059 Log(("pgmPoolAlloc Ex: returns %Rrc (Insert)\n", rc3));5067 Log(("pgmPoolAlloc: returns %Rrc (Insert)\n", rc3)); 5060 5068 return rc3; 5061 5069 } … … 5081 5089 pgmPoolLockPage(pPool, pPage); 5082 5090 pgmUnlock(pVM); 5083 LogFlow(("pgmPoolAlloc Ex: returns %Rrc *ppPage=%p:{.Key=%RHp, .idx=%d, .fCached=%RTbool, .fMonitored=%RTbool}\n",5091 LogFlow(("pgmPoolAlloc: returns %Rrc *ppPage=%p:{.Key=%RHp, .idx=%d, .fCached=%RTbool, .fMonitored=%RTbool}\n", 5084 5092 rc, pPage, pPage->Core.Key, pPage->idx, pPage->fCached, pPage->fMonitored)); 5085 5093 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); … … 5293 5301 Assert(pPage->idx == i); 5294 5302 pPage->iNext = i + 1; 5303 pPage->fA20Enabled = true; 5295 5304 pPage->fZeroed = false; /* This could probably be optimized, but better safe than sorry. */ 5296 5305 pPage->fSeenNonGlobal = false; 5297 5306 pPage->fMonitored = false; 5298 #ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT5299 5307 pPage->fDirty = false; 5300 #endif5301 5308 pPage->fCached = false; 5302 5309 pPage->fReusedFlushPending = false; … … 5304 5311 pPage->iAgeNext = NIL_PGMPOOL_IDX; 5305 5312 pPage->iAgePrev = NIL_PGMPOOL_IDX; 5313 pPage->GCPtrLastAccessHandlerRip = NIL_RTGCPTR; 5314 pPage->GCPtrLastAccessHandlerFault = NIL_RTGCPTR; 5315 pPage->cLastAccessHandler = 0; 5306 5316 pPage->cLocked = 0; 5317 #ifdef VBOX_STRICT 5318 pPage->GCPtrDirtyFault = NIL_RTGCPTR; 5319 #endif 5307 5320 } 5308 5321 pPool->aPages[pPool->cCurPages - 1].iNext = NIL_PGMPOOL_IDX; -
trunk/src/VBox/VMM/VMMR3/PGMBth.h
r39078 r41458 163 163 pVCpu->pgm.s.iShwUser = SHW_POOL_ROOT_IDX; 164 164 pVCpu->pgm.s.iShwUserTable = GCPhysCR3 >> PAGE_SHIFT; 165 int rc = pgmPoolAlloc(pVM, GCPhysCR3, BTH_PGMPOOLKIND_ROOT, pVCpu->pgm.s.iShwUser, pVCpu->pgm.s.iShwUserTable, 165 int rc = pgmPoolAlloc(pVM, GCPhysCR3, BTH_PGMPOOLKIND_ROOT, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 166 pVCpu->pgm.s.iShwUser, pVCpu->pgm.s.iShwUserTable, false /*fLockPage*/, 166 167 &pVCpu->pgm.s.pShwPageCR3R3); 167 168 if (rc == VERR_PGM_POOL_FLUSHED) -
trunk/src/VBox/VMM/VMMR3/PGMShw.h
r39739 r41458 194 194 pgmLock(pVM); 195 195 196 int rc = pgmPoolAllocEx(pVM, GCPhysCR3, PGMPOOLKIND_ROOT_NESTED, PGMPOOLACCESS_DONTCARE, PGMPOOL_IDX_NESTED_ROOT, 197 GCPhysCR3 >> PAGE_SHIFT, true /*fLockPage*/, &pNewShwPageCR3); 196 int rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_ROOT_NESTED, PGMPOOLACCESS_DONTCARE, PGM_A20_IS_ENABLED(pVCpu), 197 PGMPOOL_IDX_NESTED_ROOT, GCPhysCR3 >> PAGE_SHIFT, true /*fLockPage*/, 198 &pNewShwPageCR3); 198 199 AssertFatalRC(rc); 199 200 -
trunk/src/VBox/VMM/include/PGMInternal.h
r41456 r41458 3982 3982 # endif 3983 3983 #endif 3984 int pgmPoolAllocEx(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, uint16_t iUser, 3985 uint32_t iUserTable, bool fLockPage, PPPGMPOOLPAGE ppPage); 3986 3987 DECLINLINE(int) pgmPoolAlloc(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, uint16_t iUser, uint32_t iUserTable, 3988 PPPGMPOOLPAGE ppPage) 3989 { 3990 return pgmPoolAllocEx(pVM, GCPhys, enmKind, PGMPOOLACCESS_DONTCARE, iUser, iUserTable, false, ppPage); 3991 } 3992 3984 int pgmPoolAlloc(PVM pVM, RTGCPHYS GCPhys, PGMPOOLKIND enmKind, PGMPOOLACCESS enmAccess, bool fA20Enabled, 3985 uint16_t iUser, uint32_t iUserTable, bool fLockPage, PPPGMPOOLPAGE ppPage); 3993 3986 void pgmPoolFree(PVM pVM, RTHCPHYS HCPhys, uint16_t iUser, uint32_t iUserTable); 3994 3987 void pgmPoolFreeByPage(PPGMPOOL pPool, PPGMPOOLPAGE pPage, uint16_t iUser, uint32_t iUserTable);
Note:
See TracChangeset
for help on using the changeset viewer.