Changeset 23372 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Sep 28, 2009 12:46:22 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 52896
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.