VirtualBox

Changeset 24723 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 17, 2009 2:09:41 PM (15 years ago)
Author:
vboxsync
Message:

Introducing PGMPhysInvalidatePageMapTLBEntry

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

Legend:

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

    r24711 r24723  
    16091609    PGM_REG_COUNTER(&pPGM->StatR3PageMapTlbMisses,            "/PGM/R3/Page/MapTlbMisses",          "TLB misses.");
    16101610    PGM_REG_COUNTER(&pPGM->StatPageMapTlbFlushes,             "/PGM/R3/Page/MapTlbFlushes",         "TLB flushes (all contexts).");
     1611    PGM_REG_COUNTER(&pPGM->StatPageMapTlbFlushEntry,          "/PGM/R3/Page/MapTlbFlushEntry",      "TLB entry flushes (all contexts).");
    16111612
    16121613    PGM_REG_PROFILE(&pPGM->StatRZSyncCR3HandlerVirtualUpdate, "/PGM/RZ/SyncCR3/Handlers/VirtualUpdate", "Profiling of the virtual handler updates.");
  • trunk/src/VBox/VMM/PGMInternal.h

    r24722 r24723  
    27782778    STAMCOUNTER StatRZPageMapTlbMisses;             /**< RC/R0: Ring-3/0 page mapper TLB misses. */
    27792779    STAMCOUNTER StatPageMapTlbFlushes;              /**< ALL: Ring-3/0 page mapper TLB flushes. */
     2780    STAMCOUNTER StatPageMapTlbFlushEntry;           /**< ALL: Ring-3/0 page mapper TLB flushes. */
    27802781    STAMCOUNTER StatR3ChunkR3MapTlbHits;            /**< R3: Ring-3/0 chunk mapper TLB hits. */
    27812782    STAMCOUNTER StatR3ChunkR3MapTlbMisses;          /**< R3: Ring-3/0 chunk mapper TLB misses. */
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r24715 r24723  
    192192
    193193/**
    194  * Invalidates the all page mapping TLBs.
     194 * Invalidates all page mapping TLBs.
    195195 *
    196196 * @param   pVM     The VM handle.
     
    200200    pgmLock(pVM);
    201201    STAM_COUNTER_INC(&pVM->pgm.s.StatPageMapTlbFlushes);
     202    /* Clear the shared R0/R3 TLB completely. */
    202203    for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbHC.aEntries); i++)
    203204    {
     
    209210    /* @todo clear the RC TLB whenever we add it. */
    210211    pgmUnlock(pVM);
     212}
     213
     214/**
     215 * Invalidates a page mapping TLB entry
     216 *
     217 * @param   pVM     The VM handle.
     218 * @param   GCPhys  GCPhys entry to flush
     219 */
     220VMMDECL(void) PGMPhysInvalidatePageMapTLBEntry(PVM pVM, RTGCPHYS GCPhys)
     221{
     222    Assert(PGMIsLocked(pVM));
     223
     224    STAM_COUNTER_INC(&pVM->pgm.s.StatPageMapTlbFlushEntry);
     225    /* Clear the shared R0/R3 TLB entry. */
     226#ifdef IN_RC
     227    unsigned idx = PGM_PAGER3MAPTLB_IDX(GCPhys);
     228    pVM->pgm.s.PhysTlbHC.aEntries[idx].GCPhys = NIL_RTGCPHYS;
     229    pVM->pgm.s.PhysTlbHC.aEntries[idx].pPage = 0;
     230    pVM->pgm.s.PhysTlbHC.aEntries[idx].pMap = 0;
     231    pVM->pgm.s.PhysTlbHC.aEntries[idx].pv = 0;
     232#else
     233    PPGMPAGEMAPTLBE pTlbe = &pVM->pgm.s.CTXSUFF(PhysTlb).aEntries[PGM_PAGEMAPTLB_IDX(GCPhys)];
     234    pTlbe->GCPhys = NIL_RTGCPHYS;
     235    pTlbe->pPage  = 0;
     236    pTlbe->pMap   = 0;
     237    pTlbe->pv     = 0;
     238#endif
     239    /* @todo clear the RC TLB whenever we add it. */
    211240}
    212241
     
    399428    PGM_PAGE_SET_PAGEID(pPage, pVM->pgm.s.aHandyPages[iHandyPage].idPage);
    400429    PGM_PAGE_SET_STATE(pPage, PGM_PAGE_STATE_ALLOCATED);
    401     PGMPhysInvalidatePageMapTLB(pVM);
     430    PGMPhysInvalidatePageMapTLBEntry(pVM, GCPhys);
    402431
    403432    if (    fFlushTLBs
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