Changeset 18266 in vbox
- Timestamp:
- Mar 25, 2009 5:25:53 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
-
PGMPhys.cpp (modified) (5 diffs)
-
VMMAll/PGMAllHandler.cpp (modified) (5 diffs)
-
VMMAll/PGMAllPhys.cpp (modified) (1 diff)
-
VMMAll/PGMAllPool.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r18230 r18266 2335 2335 * 2336 2336 * @returns VBox status code. 2337 * @retval VINF_PGM_SYNC_CR3 2338 * 2337 2339 * @param pVM Pointer to the shared VM structure. 2338 2340 * @param GCPhys Where to start. Page aligned. … … 2356 2358 * Process the request. 2357 2359 */ 2358 bool fFlushedPool = false; 2360 int rc = VINF_SUCCESS; 2361 bool fFlushTLB = false; 2359 2362 for (PPGMROMRANGE pRom = pVM->pgm.s.pRomRangesR3; pRom; pRom = pRom->pNextR3) 2360 2363 if ( GCPhys <= pRom->GCPhysLast … … 2363 2366 { 2364 2367 /* 2365 * Iterate the relevant pages and the ncessary make changes.2368 * Iterate the relevant pages and make necessary the changes. 2366 2369 */ 2367 2370 bool fChanges = false; … … 2378 2381 fChanges = true; 2379 2382 2380 /* flush the page pool first so we don't leave any usage references dangling. */ 2381 if (!fFlushedPool) 2382 { 2383 pgmPoolFlushAll(pVM); 2384 fFlushedPool = true; 2385 } 2383 /* flush references to the page. */ 2384 PPGMPAGE pRamPage = pgmPhysGetPage(&pVM->pgm.s, pRom->GCPhys + (iPage << PAGE_SHIFT)); 2385 int rc2 = pgmPoolTrackFlushGCPhys(pVM, pRamPage, &fFlushTLB); 2386 if (rc2 != VINF_SUCCESS && (rc == VINF_SUCCESS || RT_FAILURE(rc2))) 2387 rc = rc2; 2386 2388 2387 2389 PPGMPAGE pOld = PGMROMPROT_IS_ROM(pRomPage->enmProt) ? &pRomPage->Virgin : &pRomPage->Shadow; 2388 2390 PPGMPAGE pNew = PGMROMPROT_IS_ROM(pRomPage->enmProt) ? &pRomPage->Shadow : &pRomPage->Virgin; 2389 PPGMPAGE pRamPage = pgmPhysGetPage(&pVM->pgm.s, pRom->GCPhys + (iPage << PAGE_SHIFT));2390 2391 2391 2392 *pOld = *pRamPage; … … 2410 2411 } 2411 2412 2412 return VINF_SUCCESS; 2413 if (fFlushTLB) 2414 PGM_INVL_GUEST_TLBS(); 2415 return rc; 2413 2416 } 2414 2417 -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r18234 r18266 169 169 { 170 170 rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pNew, pRam); 171 if (rc == VINF_PGM_GCPHYS_ALIASED) 172 { 173 pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 174 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 175 } 171 if (rc == VINF_PGM_SYNC_CR3) 172 rc = VINF_PGM_GCPHYS_ALIASED; 176 173 pVM->pgm.s.fPhysCacheFlushPending = true; 177 174 HWACCMFlushTLB(pVM); … … 203 200 * @returns VBox status code. 204 201 * @retval VINF_SUCCESS when shadow PTs was successfully updated. 205 * @retval VINF_PGM_ GCPHYS_ALIASEDwhen the shadow PTs could be updated because206 * the guest page aliased or/and mapped by multiple PTs. 202 * @retval VINF_PGM_SYNC_CR3 when the shadow PTs could be updated because 203 * the guest page aliased or/and mapped by multiple PTs. FFs set. 207 204 * @param pVM The VM handle. 208 205 * @param pCur The physical handler. … … 441 438 int rc = pgmPoolTrackFlushGCPhys(pVM, pPage, &fFlushTLBs); 442 439 AssertLogRelRCReturnVoid(rc); 443 if (rc == VINF_PGM_GCPHYS_ALIASED)444 {445 pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;446 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);447 rc = VINF_PGM_SYNC_CR3;448 }449 440 # ifdef IN_RC 450 else if (fFlushTLBs)441 if (fFlushTLBs && rc != VINF_PGM_SYNC_CR3) 451 442 PGM_INVL_GUEST_TLBS(); 452 443 # else … … 580 571 */ 581 572 rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pCur, pRam); 582 if (rc == VINF_PGM_GCPHYS_ALIASED)583 {584 pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;585 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);586 }587 573 pVM->pgm.s.fPhysCacheFlushPending = true; 588 574 … … 891 877 */ 892 878 rc = pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(pVM, pCur, pRam); 893 if (rc == VINF_PGM_GCPHYS_ALIASED)894 {895 pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;896 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3);897 }898 879 pVM->pgm.s.fPhysCacheFlushPending = true; 899 880 HWACCMFlushTLB(pVM); -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r18230 r18266 382 382 bool fFlushTLBs = false; 383 383 int rc = pgmPoolTrackFlushGCPhys(pVM, pPage, &fFlushTLBs); 384 if (rc == VINF_SUCCESS) 385 /* nothing */; 386 else if (rc == VINF_PGM_GCPHYS_ALIASED) 387 { 388 pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 389 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 390 rc = VINF_PGM_SYNC_CR3; 391 } 392 else 393 { 394 AssertRCReturn(rc, rc); 395 AssertMsgFailedReturn(("%Rrc\n", rc), VERR_INTERNAL_ERROR); 396 } 384 AssertMsgReturn(rc == VINF_SUCCESS || rc == VINF_PGM_GCPHYS_ALIASED, ("%Rrc\n", rc), RT_FAILURE(rc) ? rc : VERR_INTERNAL_ERROR); 397 385 398 386 /* -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r18215 r18266 2630 2630 * @returns VBox status code. 2631 2631 * @retval VINF_SUCCESS if all references has been successfully cleared. 2632 * @retval VINF_PGM_ GCPHYS_ALIASED if we're better off with a CR3 sync and2633 * a page pool cleaning.2632 * @retval VINF_PGM_SYNC_CR3 if we're better off with a CR3 sync and a page 2633 * pool cleaning. FF and sync flags are set. 2634 2634 * 2635 2635 * @param pVM The VM handle. … … 2706 2706 rc = VINF_PGM_GCPHYS_ALIASED; 2707 2707 #endif 2708 2709 if (rc == VINF_PGM_GCPHYS_ALIASED) 2710 { 2711 pVM->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 2712 VM_FF_SET(pVM, VM_FF_PGM_SYNC_CR3); 2713 rc = VINF_PGM_SYNC_CR3; 2714 } 2708 2715 2709 2716 return rc; … … 3954 3961 } 3955 3962 3956 /* Force a shadow mode reinit (necessary for nested paging and ept). */ 3963 /* 3964 * Force a shadow mode reinit (necessary for nested paging and ept). 3965 * Reinit the current shadow paging mode as well; nested paging and 3966 * EPT use a root CR3 which will get flushed here. 3967 */ 3957 3968 pVM->pgm.s.enmShadowMode = PGMMODE_INVALID; 3958 3959 /* Reinit the current shadow paging mode as well; nested paging and EPT use a root CR3 which will get flushed here. */3960 3969 rc = PGMR3ChangeMode(pVM, PGMGetGuestMode(pVM)); 3961 3970 AssertRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.

