VirtualBox

Changeset 23372 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Sep 28, 2009 12:46:22 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52896
Message:

pgmR3PoolClearAll.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r23283 r23372  
    25492549}
    25502550
    2551 
    25522551#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).
    25572561 * @param   pVM     The VM handle.
    25582562 * @param   pVCpu   The VMCPU for the EMT we're being called on. Unused.
     
    25612565 * @remark  Should only be used when monitoring is available, thus placed in
    25622566 *          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 */
     2570static DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *pvUser)
    25652571{
    25662572    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
    25672573    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));
    25702575
    25712576    pgmLock(pVM);
     
    25762581
    25772582    /*
    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.
    25792584     * This is simple but not quite optimal solution.
    25802585     */
     
    27072712    return VINF_SUCCESS;
    27082713}
     2714
     2715
     2716/**
     2717 * Clears the shadow page pool.
     2718 *
     2719 * @param   pVM         The VM handle.
     2720 */
     2721void pgmR3PoolClearAll(PVM pVM)
     2722{
     2723    int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmR3PoolClearAllRendezvous, NULL);
     2724    AssertRC(rc);
     2725}
     2726
    27092727#endif /* IN_RING3 */
    2710 
    27112728
    27122729/**
     
    27322749     */
    27332750# 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);
    27392753# else  /* !IN_RING3 */
    27402754    if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)
     
    50395053 * Flushes the entire cache.
    50405054 *
    5041  * It will assert a global CR3 flush (FF) and assumes the caller is aware of this
    5042  * 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.
    50435057 *
    50445058 * @param   pPool       The pool.
     
    50495063
    50505064    Assert(PGMIsLockOwner(pVM));
    5051     STAM_PROFILE_START(&pPool->StatFlushAllInt, a);
    5052     LogFlow(("pgmPoolFlushAllInt:\n"));
     5065    STAM_PROFILE_START(&pPool->StatR3Reset, a);
     5066    LogFlow(("pgmR3PoolReset:\n"));
    50535067
    50545068    /*
     
    50575071    if (pPool->cCurPages <= PGMPOOL_IDX_FIRST)
    50585072    {
    5059         STAM_PROFILE_STOP(&pPool->StatFlushAllInt, a);
     5073        STAM_PROFILE_STOP(&pPool->StatR3Reset, a);
    50605074        return;
    50615075    }
     
    52315245    }
    52325246
    5233     STAM_PROFILE_STOP(&pPool->StatFlushAllInt, a);
     5247    STAM_PROFILE_STOP(&pPool->StatR3Reset, a);
    52345248}
    52355249#endif /* IN_RING3 */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette