VirtualBox

Changeset 23372 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 28, 2009 12:46:22 PM (15 years ago)
Author:
vboxsync
Message:

pgmR3PoolClearAll.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/EMRaw.cpp

    r22493 r23372  
    13321332     * The CSAMR3CheckGates call in TRPMR3SyncIDT may call PGMPrefetchPage
    13331333     * and PGMShwModifyPage, so we're in for trouble if for instance a
    1334      * PGMSyncCR3+pgmPoolClearAll is pending.
     1334     * PGMSyncCR3+pgmR3PoolClearAll is pending.
    13351335     */
    13361336    if (VMCPU_FF_ISPENDING(pVCpu, VMCPU_FF_TRPM_SYNC_IDT))
  • trunk/src/VBox/VMM/PGMInternal.h

    r23307 r23372  
    18351835    /** Profiling pgmPoolAlloc(). */
    18361836    STAMPROFILEADV              StatAlloc;
    1837     /** Profiling pgmPoolClearAll(). */
     1837    /** Profiling pgmR3PoolClearDoIt(). */
    18381838    STAMPROFILE                 StatClearAll;
    1839     /** Profiling pgmPoolFlushAllInt(). */
    1840     STAMPROFILE                 StatFlushAllInt;
     1839    /** Profiling pgmR3PoolReset(). */
     1840    STAMPROFILE                 StatR3Reset;
    18411841    /** Profiling pgmPoolFlushPage(). */
    18421842    STAMPROFILE                 StatFlushPage;
     
    31663166void            pgmR3PoolRelocate(PVM pVM);
    31673167void            pgmR3PoolReset(PVM pVM);
     3168void            pgmR3PoolClearAll(PVM pVM);
    31683169
    31693170#endif /* IN_RING3 */
     
    31823183int             pgmPoolFlushPage(PPGMPOOL pPool, PPGMPOOLPAGE pPage);
    31833184void            pgmPoolFlushPageByGCPhys(PVM pVM, RTGCPHYS GCPhys);
    3184 void            pgmPoolClearAll(PVM pVM);
    31853185PPGMPOOLPAGE    pgmPoolGetPage(PPGMPOOL pPool, RTHCPHYS HCPhys);
    31863186int             pgmPoolSyncCR3(PVMCPU pVCpu);
  • trunk/src/VBox/VMM/PGMPool.cpp

    r23121 r23372  
    333333    STAM_REG(pVM, &pPool->cUsedPagesHigh,               STAMTYPE_U16_RESET, "/PGM/Pool/cUsedPagesHigh", STAMUNIT_PAGES,             "The high watermark for cUsedPages.");
    334334    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 pgmPoolClearAll.");
    336     STAM_REG(pVM, &pPool->StatFlushAllInt,              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.");
    337337    STAM_REG(pVM, &pPool->StatFlushPage,                STAMTYPE_PROFILE,   "/PGM/Pool/FlushPage",      STAMUNIT_TICKS_PER_CALL,    "Profiling of pgmPoolFlushPage.");
    338338    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  
    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.

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