VirtualBox

Changeset 77240 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Feb 10, 2019 4:34:51 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128747
Message:

PGMPool: Two optimizations to the dirty page code (PGMPOOL_WITH_OPTIMIZED_DIRTY_PT): Inline the first part of pgmPoolIsDirtyPage so we don't waste time on a full fledged call for nested paging. Split the PGMPOOL::aDirtyPages structure into index and page data so we can scan the indexes without requiring a cache line load for each entry. Also eliminated some double uIdx reads and checks.

Location:
trunk/src/VBox/VMM/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/PGMInline.h

    r76585 r77240  
    14961496
    14971497/**
     1498 * Check if the specified page is dirty (not write monitored)
     1499 *
     1500 * @return dirty or not
     1501 * @param   pVM             The cross context VM structure.
     1502 * @param   GCPhys          Guest physical address
     1503 */
     1504DECLINLINE(bool) pgmPoolIsDirtyPage(PVM pVM, RTGCPHYS GCPhys)
     1505{
     1506    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     1507    PGM_LOCK_ASSERT_OWNER(pVM);
     1508    if (!pPool->cDirtyPages)
     1509        return false;
     1510    return pgmPoolIsDirtyPageSlow(pVM, GCPhys);
     1511}
     1512
     1513
     1514/**
    14981515 * Tells if mappings are to be put into the shadow page table or not.
    14991516 *
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r76993 r77240  
    24762476    uint32_t                    cDirtyPages;
    24772477    /** Array of current dirty pgm pool page indices. */
     2478    uint16_t                    aidxDirtyPages[16];
     2479    /** Array running in parallel to aidxDirtyPages with the page data. */
    24782480    struct
    24792481    {
    2480         uint16_t                    uIdx;
    2481         uint16_t                    Alignment[3];
    2482         uint64_t                    aPage[512];
     2482        uint64_t                aPage[512];
    24832483    } aDirtyPages[16];
     2484
    24842485    /** The number of pages currently in use. */
    24852486    uint16_t                    cUsedPages;
     
    42944295PPGMPOOLPAGE    pgmPoolQueryPageForDbg(PPGMPOOL pPool, RTHCPHYS HCPhys);
    42954296int             pgmPoolSyncCR3(PVMCPU pVCpu);
    4296 bool            pgmPoolIsDirtyPage(PVM pVM, RTGCPHYS GCPhys);
     4297bool            pgmPoolIsDirtyPageSlow(PVM pVM, RTGCPHYS GCPhys);
    42974298void            pgmPoolInvalidateDirtyPage(PVM pVM, RTGCPHYS GCPhysPT);
    42984299int             pgmPoolTrackUpdateGCPhys(PVM pVM, RTGCPHYS GCPhysPage, PPGMPAGE pPhysPage, bool fFlushPTEs, bool *pfFlushTLBs);
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