VirtualBox

Changeset 22709 in vbox


Ignore:
Timestamp:
Sep 2, 2009 11:46:18 AM (15 years ago)
Author:
vboxsync
Message:

Also check for dirty pages

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMInternal.h

    r22695 r22709  
    30553055PPGMPOOLPAGE    pgmPoolGetPage(PPGMPOOL pPool, RTHCPHYS HCPhys);
    30563056int             pgmPoolSyncCR3(PVMCPU pVCpu);
     3057bool            pgmPoolIsDirtyPage(PVM pVM, RTGCPHYS GCPhys);
    30573058int             pgmPoolTrackFlushGCPhys(PVM pVM, PPGMPAGE pPhysPage, bool *pfFlushTLBs);
    30583059uint16_t        pgmPoolTrackPhysExtAddref(PVM pVM, uint16_t u16, uint16_t iShwPT);
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r22698 r22709  
    375375        }
    376376        else
    377         if (PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage))
     377        if (    PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage)
     378#ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT
     379            ||  pgmPoolIsDirtyPage(pVM, GCPhys)
     380#endif
     381           )
    378382        {
    379383            /* We *must* flush any corresponding pgm pool page here, otherwise we'll
     
    445449             */
    446450            if (    PGM_PAGE_HAS_ACTIVE_HANDLERS(pPage)
     451#ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT
     452                ||  pgmPoolIsDirtyPage(pVM, GCPhys)
     453#endif
    447454                ||  RT_UNLIKELY(PGM_PAGE_GET_STATE(pPage) != PGM_PAGE_STATE_ALLOCATED))
    448455            {
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r22701 r22709  
    16091609
    16101610/**
     1611 * Check if the specified page is dirty (not write monitored)
     1612 *
     1613 * @return dirty or not
     1614 * @param   pVM             VM Handle.
     1615 * @param   GCPhys          Guest physical address
     1616 */
     1617bool pgmPoolIsDirtyPage(PVM pVM, RTGCPHYS GCPhys)
     1618{
     1619    if (!pPool->cDirtyPages)
     1620        return false;
     1621
     1622    for (unsigned i = 0; i < RT_ELEMENTS(pPool->aIdxDirtyPages); i++)
     1623    {
     1624        if (pPool->aIdxDirtyPages[idxSlot] != NIL_PGMPOOL_IDX)
     1625        {
     1626            PPGMPOOLPAGE pPage;
     1627            unsigned     idxPage = pPool->aIdxDirtyPages[idxSlot];
     1628            AssertRelease(idxPage != NIL_PGMPOOL_IDX);
     1629
     1630            pPage = &pPool->aPages[idxPage];
     1631            if (pPage->GCPhys == GCPhys)
     1632                return true;
     1633        }
     1634    }
     1635    return false;
     1636}
     1637
     1638/**
    16111639 * Reset all dirty pages by reinstating page monitoring.
    16121640 *
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