VirtualBox

Changeset 24960 in vbox


Ignore:
Timestamp:
Nov 25, 2009 3:58:56 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55258
Message:

Experimental code added (not used!)

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

Legend:

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

    r24874 r24960  
    33743374bool            pgmPoolIsDirtyPage(PVM pVM, RTGCPHYS GCPhys);
    33753375int             pgmPoolTrackUpdateGCPhys(PVM pVM, PPGMPAGE pPhysPage, bool fFlushPTEs, bool *pfFlushTLBs);
     3376void            pgmPoolInvalidateDirtyPage(PVM pVM, RTGCPHYS GCPhysPT);
    33763377DECLINLINE(int) pgmPoolTrackFlushGCPhys(PVM pVM, PPGMPAGE pPhysPage, bool *pfFlushTLBs)
    33773378{
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r24764 r24960  
    17881788    return;
    17891789}
     1790
     1791/**
     1792 * Reset all dirty pages by reinstating page monitoring.
     1793 *
     1794 * @param   pVM             VM Handle.
     1795 * @param   GCPhysPT        Physical address of the page table
     1796 */
     1797void pgmPoolInvalidateDirtyPage(PVM pVM, RTGCPHYS GCPhysPT)
     1798{
     1799    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     1800    Assert(PGMIsLocked(pVM));
     1801    Assert(pPool->cDirtyPages <= RT_ELEMENTS(pPool->aIdxDirtyPages));
     1802    unsigned idxDirtyPage = RT_ELEMENTS(pPool->aIdxDirtyPages);
     1803
     1804    if (!pPool->cDirtyPages)
     1805        return;
     1806
     1807    GCPhysPT = GCPhysPT & ~(RTGCPHYS)(PAGE_SIZE - 1);
     1808
     1809    for (unsigned i = 0; i < RT_ELEMENTS(pPool->aIdxDirtyPages); i++)
     1810    {
     1811        if (pPool->aIdxDirtyPages[i] != NIL_PGMPOOL_IDX)
     1812        {
     1813            unsigned     idxPage = pPool->aIdxDirtyPages[i];
     1814
     1815            PPGMPOOLPAGE pPage = &pPool->aPages[idxPage];
     1816            if (pPage->GCPhys == GCPhysPT)
     1817            {
     1818                idxDirtyPage = i;
     1819                break;
     1820            }
     1821        }
     1822    }
     1823
     1824    if (idxDirtyPage != RT_ELEMENTS(pPool->aIdxDirtyPages))
     1825    {
     1826        pgmPoolFlushDirtyPage(pVM, pPool, idxDirtyPage, true /* allow removal of reused page tables*/);
     1827        if (    pPool->cDirtyPages != RT_ELEMENTS(pPool->aIdxDirtyPages)
     1828            &&  pPool->aIdxDirtyPages[pPool->idxFreeDirtyPage] != NIL_PGMPOOL_IDX)
     1829        {
     1830            unsigned i;
     1831            for (i = 0; i < RT_ELEMENTS(pPool->aIdxDirtyPages); i++)
     1832            {
     1833                if (pPool->aIdxDirtyPages[i] == NIL_PGMPOOL_IDX)
     1834                {
     1835                    pPool->idxFreeDirtyPage = i;
     1836                    break;
     1837                }
     1838            }
     1839            AssertMsg(i != RT_ELEMENTS(pPool->aIdxDirtyPages), ("cDirtyPages %d", pPool->cDirtyPages));
     1840        }
     1841    }
     1842}
     1843
    17901844# endif /* PGMPOOL_WITH_OPTIMIZED_DIRTY_PT */
    17911845#endif  /* PGMPOOL_WITH_MONITORING */
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