Changeset 23372 in vbox for trunk/src/VBox
- Timestamp:
- Sep 28, 2009 12:46:22 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EMRaw.cpp
r22493 r23372 1332 1332 * The CSAMR3CheckGates call in TRPMR3SyncIDT may call PGMPrefetchPage 1333 1333 * and PGMShwModifyPage, so we're in for trouble if for instance a 1334 * PGMSyncCR3+pgm PoolClearAll is pending.1334 * PGMSyncCR3+pgmR3PoolClearAll is pending. 1335 1335 */ 1336 1336 if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_TRPM_SYNC_IDT)) -
trunk/src/VBox/VMM/PGMInternal.h
r23307 r23372 1835 1835 /** Profiling pgmPoolAlloc(). */ 1836 1836 STAMPROFILEADV StatAlloc; 1837 /** Profiling pgm PoolClearAll(). */1837 /** Profiling pgmR3PoolClearDoIt(). */ 1838 1838 STAMPROFILE StatClearAll; 1839 /** Profiling pgm PoolFlushAllInt(). */1840 STAMPROFILE Stat FlushAllInt;1839 /** Profiling pgmR3PoolReset(). */ 1840 STAMPROFILE StatR3Reset; 1841 1841 /** Profiling pgmPoolFlushPage(). */ 1842 1842 STAMPROFILE StatFlushPage; … … 3166 3166 void pgmR3PoolRelocate(PVM pVM); 3167 3167 void pgmR3PoolReset(PVM pVM); 3168 void pgmR3PoolClearAll(PVM pVM); 3168 3169 3169 3170 #endif /* IN_RING3 */ … … 3182 3183 int pgmPoolFlushPage(PPGMPOOL pPool, PPGMPOOLPAGE pPage); 3183 3184 void pgmPoolFlushPageByGCPhys(PVM pVM, RTGCPHYS GCPhys); 3184 void pgmPoolClearAll(PVM pVM);3185 3185 PPGMPOOLPAGE pgmPoolGetPage(PPGMPOOL pPool, RTHCPHYS HCPhys); 3186 3186 int pgmPoolSyncCR3(PVMCPU pVCpu); -
trunk/src/VBox/VMM/PGMPool.cpp
r23121 r23372 333 333 STAM_REG(pVM, &pPool->cUsedPagesHigh, STAMTYPE_U16_RESET, "/PGM/Pool/cUsedPagesHigh", STAMUNIT_PAGES, "The high watermark for cUsedPages."); 334 334 STAM_REG(pVM, &pPool->StatAlloc, STAMTYPE_PROFILE_ADV, "/PGM/Pool/Alloc", STAMUNIT_TICKS_PER_CALL, "Profiling of pgmPoolAlloc."); 335 STAM_REG(pVM, &pPool->StatClearAll, STAMTYPE_PROFILE, "/PGM/Pool/ClearAll", STAMUNIT_TICKS_PER_CALL, "Profiling of pgm PoolClearAll.");336 STAM_REG(pVM, &pPool->Stat FlushAllInt, STAMTYPE_PROFILE, "/PGM/Pool/FlushAllInt", STAMUNIT_TICKS_PER_CALL, "Profiling of pgmPoolFlushAllInt.");335 STAM_REG(pVM, &pPool->StatClearAll, STAMTYPE_PROFILE, "/PGM/Pool/ClearAll", STAMUNIT_TICKS_PER_CALL, "Profiling of pgmR3PoolClearAll."); 336 STAM_REG(pVM, &pPool->StatR3Reset, STAMTYPE_PROFILE, "/PGM/Pool/R3Reset", STAMUNIT_TICKS_PER_CALL, "Profiling of pgmR3PoolReset."); 337 337 STAM_REG(pVM, &pPool->StatFlushPage, STAMTYPE_PROFILE, "/PGM/Pool/FlushPage", STAMUNIT_TICKS_PER_CALL, "Profiling of pgmPoolFlushPage."); 338 338 STAM_REG(pVM, &pPool->StatFree, STAMTYPE_PROFILE, "/PGM/Pool/Free", STAMUNIT_TICKS_PER_CALL, "Profiling of pgmPoolFree."); -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r23283 r23372 2549 2549 } 2550 2550 2551 2552 2551 #ifdef IN_RING3 2553 /** 2554 * Callback to clear all shadow pages and clear all modification counters. 2555 * 2556 * @returns VBox strict status code. 2552 2553 /** 2554 * Rendezvous callback used by pgmR3PoolClearAll that clears all shadow pages 2555 * and all modification counters. 2556 * 2557 * This is only called on one of the EMTs while the other ones are waiting for 2558 * it to complete this function. 2559 * 2560 * @returns VINF_SUCCESS (VBox strict status code). 2557 2561 * @param pVM The VM handle. 2558 2562 * @param pVCpu The VMCPU for the EMT we're being called on. Unused. … … 2561 2565 * @remark Should only be used when monitoring is available, thus placed in 2562 2566 * the PGMPOOL_WITH_MONITORING \#ifdef. 2563 */ 2564 DECLCALLBACK(VBOXSTRICTRC) pgmPoolClearAll(PVM pVM, PVMCPU pVCpu, void *pvUser) 2567 * @remark Too expensive for use in R0/RC, but it remains here because of 2568 * dependencies? 2569 */ 2570 static DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *pvUser) 2565 2571 { 2566 2572 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 2567 2573 STAM_PROFILE_START(&pPool->StatClearAll, c); 2568 LogFlow(("pgmPoolClearAll: cUsedPages=%d\n", pPool->cUsedPages)); 2569 NOREF(pvUser); NOREF(pVCpu); 2574 LogFlow(("pgmPoolClearAllDoIt: cUsedPages=%d\n", pPool->cUsedPages)); 2570 2575 2571 2576 pgmLock(pVM); … … 2576 2581 2577 2582 /* 2578 * Iterate all the pages until we've encountered all that in use.2583 * Iterate all the pages until we've encountered all that are in use. 2579 2584 * This is simple but not quite optimal solution. 2580 2585 */ … … 2707 2712 return VINF_SUCCESS; 2708 2713 } 2714 2715 2716 /** 2717 * Clears the shadow page pool. 2718 * 2719 * @param pVM The VM handle. 2720 */ 2721 void pgmR3PoolClearAll(PVM pVM) 2722 { 2723 int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmR3PoolClearAllRendezvous, NULL); 2724 AssertRC(rc); 2725 } 2726 2709 2727 #endif /* IN_RING3 */ 2710 2711 2728 2712 2729 /** … … 2732 2749 */ 2733 2750 # ifdef IN_RING3 /* Don't flush in ring-0 or raw mode, it's taking too long. */ 2734 if (ASMBitTestAndClear(&pVCpu->pgm.s.fSyncFlags, PGM_SYNC_CLEAR_PGM_POOL_BIT)) 2735 { 2736 int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmPoolClearAll, NULL); 2737 AssertRC(rc); 2738 } 2751 if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) 2752 pgmR3PoolClearAll(pVM); 2739 2753 # else /* !IN_RING3 */ 2740 2754 if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL) … … 5039 5053 * Flushes the entire cache. 5040 5054 * 5041 * It will assert a global CR3 flush (FF) and assumes the caller is aware of this5042 * and execute this CR3 flush.5055 * It will assert a global CR3 flush (FF) and assumes the caller is aware of 5056 * this and execute this CR3 flush. 5043 5057 * 5044 5058 * @param pPool The pool. … … 5049 5063 5050 5064 Assert(PGMIsLockOwner(pVM)); 5051 STAM_PROFILE_START(&pPool->Stat FlushAllInt, a);5052 LogFlow(("pgm PoolFlushAllInt:\n"));5065 STAM_PROFILE_START(&pPool->StatR3Reset, a); 5066 LogFlow(("pgmR3PoolReset:\n")); 5053 5067 5054 5068 /* … … 5057 5071 if (pPool->cCurPages <= PGMPOOL_IDX_FIRST) 5058 5072 { 5059 STAM_PROFILE_STOP(&pPool->Stat FlushAllInt, a);5073 STAM_PROFILE_STOP(&pPool->StatR3Reset, a); 5060 5074 return; 5061 5075 } … … 5231 5245 } 5232 5246 5233 STAM_PROFILE_STOP(&pPool->Stat FlushAllInt, a);5247 STAM_PROFILE_STOP(&pPool->StatR3Reset, a); 5234 5248 } 5235 5249 #endif /* IN_RING3 */
Note:
See TracChangeset
for help on using the changeset viewer.