Changeset 17667 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Mar 11, 2009 9:35:22 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r17658 r17667 940 940 /* Create a reference back to the PDPT by using the index in its shadow page. */ 941 941 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPdPt, &pShwPage); 942 if (rc == VERR_PGM_POOL_FLUSHED)943 {944 Log(("pgmShwSyncPaePDPtr: PGM pool flushed -> signal sync cr3\n"));945 Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);946 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);947 # if defined(IN_RC)948 PGMDynUnlockHCPage(pVM, (uint8_t *)pPdpe);949 # endif950 return VINF_PGM_SYNC_CR3;951 }952 942 AssertRCReturn(rc, rc); 953 943 … … 1057 1047 /* Create a reference back to the PDPT by using the index in its shadow page. */ 1058 1048 rc = pgmPoolAlloc(pVM, GCPml4, enmKind, pVM->pgm.s.CTX_SUFF(pShwPageCR3)->idx, iPml4, &pShwPage); 1059 if (rc == VERR_PGM_POOL_FLUSHED)1060 {1061 Log(("PGMShwSyncLongModePDPtr: PGM pool flushed (1) -> signal sync cr3\n"));1062 Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);1063 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);1064 return VINF_PGM_SYNC_CR3;1065 }1066 1049 AssertRCReturn(rc, rc); 1067 1050 } … … 1102 1085 /* Create a reference back to the PDPT by using the index in its shadow page. */ 1103 1086 rc = pgmPoolAlloc(pVM, GCPdPt, enmKind, pShwPage->idx, iPdPt, &pShwPage); 1104 if (rc == VERR_PGM_POOL_FLUSHED)1105 {1106 Log(("PGMShwSyncLongModePDPtr: PGM pool flushed (2) -> signal sync cr3\n"));1107 Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);1108 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);1109 return VINF_PGM_SYNC_CR3;1110 }1111 1087 AssertRCReturn(rc, rc); 1112 1088 } … … 1196 1172 1197 1173 rc = pgmPoolAlloc(pVM, GCPml4, PGMPOOLKIND_EPT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4, &pShwPage); 1198 if (rc == VERR_PGM_POOL_FLUSHED)1199 {1200 Log(("PGMShwSyncEPTPDPtr: PGM pool flushed (1) -> signal sync cr3\n"));1201 Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);1202 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);1203 return VINF_PGM_SYNC_CR3;1204 }1205 1174 AssertRCReturn(rc, rc); 1206 1175 } … … 1230 1199 1231 1200 rc = pgmPoolAlloc(pVM, GCPdPt, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage); 1232 if (rc == VERR_PGM_POOL_FLUSHED)1233 {1234 Log(("PGMShwSyncEPTPDPtr: PGM pool flushed (2) -> signal sync cr3\n"));1235 Assert(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL);1236 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);1237 return VINF_PGM_SYNC_CR3;1238 }1239 1201 AssertRCReturn(rc, rc); 1240 1202 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r17660 r17667 4273 4273 Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32))); 4274 4274 rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3); 4275 if (rc == VERR_PGM_POOL_FLUSHED) 4276 { 4277 Log(("MapCR3: PGM pool flushed -> signal sync cr3\n")); 4278 Assert(VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)); 4279 return VINF_PGM_SYNC_CR3; 4280 } 4281 AssertRCReturn(rc, rc); 4275 AssertFatalRC(rc); 4282 4276 rc = VINF_SUCCESS; 4283 4277 -
trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp
r17639 r17667 299 299 int rc = pgmShwSyncPaePDPtr(pVM, (iPdPt << X86_PDPT_SHIFT), &GstPdpe, &pShwPaePd); 300 300 AssertFatal(RT_SUCCESS(rc)); 301 if (rc != VINF_SUCCESS)302 {303 rc = pgmShwSyncPaePDPtr(pVM, (iPdPt << X86_PDPT_SHIFT), &GstPdpe, &pShwPaePd);304 AssertFatalMsg(rc == VINF_SUCCESS, ("rc = %Rrc\n", rc));305 }306 301 } 307 302 Assert(pShwPaePd); -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r17659 r17667 191 191 { 192 192 int rc2 = pgmPoolFlushPage(pPool, pPage); 193 if (rc2 == VERR_PGM_POOL_CLEARED && rc == VINF_SUCCESS) 194 rc = VINF_PGM_SYNC_CR3; 193 AssertRC(rc2); 195 194 } 196 195 /* next */ … … 1233 1232 * @returns VBox status code. 1234 1233 * @retval VINF_SUCCESS on success. 1235 * @retval VERR_PGM_POOL_CLEARED if the deregistration of a physical handler will cause a light weight pool flush.1236 1234 * @param pPool The pool. 1237 1235 * @param iUser The user index. … … 1451 1449 { 1452 1450 STAM_COUNTER_INC(&pPool->StatCacheKindMismatches); 1453 pgmPoolFlushPage(pPool, pPage); /* ASSUMES that VERR_PGM_POOL_CLEARED will be returned by pgmPoolTracInsert. */1451 pgmPoolFlushPage(pPool, pPage); 1454 1452 PGM_INVL_GUEST_TLBS(); /* see PT handler. */ 1455 1453 break; … … 1632 1630 * @returns VBox status code. 1633 1631 * @retval VINF_SUCCESS on success. 1634 * @retval VERR_PGM_POOL_CLEARED if the registration of the physical handler will cause a light weight pool flush.1635 1632 * @param pPool The pool. 1636 1633 * @param pPage The cached page. … … 1719 1716 * the heap size should suffice. */ 1720 1717 AssertFatalRC(rc); 1721 if (pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) 1722 rc = VERR_PGM_POOL_CLEARED; 1718 Assert(!(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) || VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)); 1723 1719 } 1724 1720 pPage->fMonitored = true; … … 1732 1728 * @returns VBox status code. 1733 1729 * @retval VINF_SUCCESS on success. 1734 * @retval VERR_PGM_POOL_CLEARED if the deregistration of the physical handler will cause a light weight pool flush.1735 1730 * @param pPool The pool. 1736 1731 * @param pPage The cached page. … … 1818 1813 rc = PGMHandlerPhysicalDeregister(pVM, pPage->GCPhys & ~(RTGCPHYS)(PAGE_SIZE - 1)); 1819 1814 AssertFatalRC(rc); 1820 if (pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) 1821 rc = VERR_PGM_POOL_CLEARED; 1815 Assert(!(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) || VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3)); 1822 1816 } 1823 1817 pPage->fMonitored = false; … … 2117 2111 * Lazy approach. 2118 2112 */ 2119 /* @todo incompatible with long mode paging (cr3 root will be flushed) */ 2113 /* @todo This path no longer works (CR3 root pages will be flushed)!! */ 2114 AssertCompileFailed(); 2120 2115 Assert(!CPUMIsGuestInLongMode(pVM)); 2121 2116 pgmPoolFlushAllInt(pPool); … … 2134 2129 * @retval VINF_SUCCESS if successfully added. 2135 2130 * @retval VERR_PGM_POOL_FLUSHED if the pool was flushed. 2136 * @retval VERR_PGM_POOL_CLEARED if the deregistration of the physical handler will cause a light weight pool flush.2137 2131 * @param pPool The pool. 2138 2132 * @param pPage The cached page. … … 2213 2207 # ifdef PGMPOOL_WITH_MONITORING 2214 2208 rc = pgmPoolMonitorInsert(pPool, pPage); 2215 if (rc == VERR_PGM_POOL_CLEARED) 2216 { 2217 /* 'Failed' - free the usage, and keep it in the cache (if enabled). */ 2218 # ifndef PGMPOOL_WITH_CACHE 2219 pgmPoolMonitorFlush(pPool, pPage); 2220 rc = VERR_PGM_POOL_FLUSHED; 2221 # endif 2222 pPage->iUserHead = NIL_PGMPOOL_USER_INDEX; 2223 paUsers[i].iNext = pPool->iUserFreeHead; 2224 paUsers[i].iUser = NIL_PGMPOOL_IDX; 2225 pPool->iUserFreeHead = i; 2226 } 2209 AssertRC(rc); 2227 2210 } 2228 2211 # endif … … 3995 3978 * @returns VBox status code. 3996 3979 * @retval VINF_SUCCESS on success. 3997 * @retval VERR_PGM_POOL_CLEARED if the deregistration of the physical handler will cause a light weight pool flush.3998 3980 * @param pPool The pool. 3999 3981 * @param HCPhys The HC physical address of the shadow page. … … 4011 3993 if (pPage->idx < PGMPOOL_IDX_FIRST) 4012 3994 { 3995 AssertFailed(); /* can no longer happen */ 4013 3996 Log(("pgmPoolFlushPage: special root page, rejected. enmKind=%s idx=%d\n", pgmPoolPoolKindToStr(pPage->enmKind), pPage->idx)); 4014 3997 return VINF_SUCCESS; … … 4114 4097 if (!pPage->fCached) 4115 4098 #endif 4116 pgmPoolFlushPage(pPool, pPage); /* ASSUMES that VERR_PGM_POOL_CLEARED can be ignored here. */4099 pgmPoolFlushPage(pPool, pPage); 4117 4100 STAM_PROFILE_STOP(&pPool->StatFree, a); 4118 4101 } … … 4170 4153 * a cheap replacement strategy... 4171 4154 */ 4172 /* @todo incompatible with long mode paging (cr3 root will be flushed) */ 4155 /* @todo This path no longer works (CR3 root pages will be flushed)!! */ 4156 AssertCompileFailed(); 4173 4157 Assert(!CPUMIsGuestInLongMode(pVM)); 4174 4158 pgmPoolFlushAllInt(pPool); … … 4230 4214 if (RT_FAILURE(rc)) 4231 4215 { 4232 if (rc != VERR_PGM_POOL_CLEARED) 4233 { 4234 Log(("pgmPoolAlloc: returns %Rrc (Free)\n", rc)); 4235 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 4236 return rc; 4237 } 4238 Log(("pgmPoolMakeMoreFreePages failed with %Rrc -> return VERR_PGM_POOL_FLUSHED\n", rc)); 4239 rc = VERR_PGM_POOL_FLUSHED; 4216 Log(("pgmPoolAlloc: returns %Rrc (Free)\n", rc)); 4217 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 4218 return rc; 4240 4219 } 4241 4220 iNew = pPool->iFreeHead; … … 4275 4254 if (RT_FAILURE(rc3)) 4276 4255 { 4277 if (rc3 != VERR_PGM_POOL_CLEARED) 4278 { 4279 pPool->cUsedPages--; 4280 pPage->enmKind = PGMPOOLKIND_FREE; 4281 pPage->GCPhys = NIL_RTGCPHYS; 4282 pPage->iNext = pPool->iFreeHead; 4283 pPool->iFreeHead = pPage->idx; 4284 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 4285 Log(("pgmPoolAlloc: returns %Rrc (Insert)\n", rc3)); 4286 return rc3; 4287 } 4288 Log(("pgmPoolTrackInsert failed with %Rrc -> return VERR_PGM_POOL_FLUSHED\n", rc3)); 4289 rc = VERR_PGM_POOL_FLUSHED; 4256 pPool->cUsedPages--; 4257 pPage->enmKind = PGMPOOLKIND_FREE; 4258 pPage->GCPhys = NIL_RTGCPHYS; 4259 pPage->iNext = pPool->iFreeHead; 4260 pPool->iFreeHead = pPage->idx; 4261 STAM_PROFILE_ADV_STOP(&pPool->StatAlloc, a); 4262 Log(("pgmPoolAlloc: returns %Rrc (Insert)\n", rc3)); 4263 return rc3; 4290 4264 } 4291 4265 #endif /* PGMPOOL_WITH_USER_TRACKING */
Note:
See TracChangeset
for help on using the changeset viewer.