VirtualBox

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


Ignore:
Timestamp:
Feb 17, 2011 10:15:02 AM (14 years ago)
Author:
vboxsync
Message:

PGM: Fixed large pages and write monitoring (live snapshot). Added checks for PGM_PAGE_PDE_TYPE_PDE_DISABLED in a few places where only PGM_PAGE_PDE_TYPE_PDE was checked for (might have missed some).

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

Legend:

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

    r35346 r36009  
    563563
    564564#endif /* !IN_RC */
     565
     566
     567/**
     568 * Enables write monitoring for an allocated page.
     569 * 
     570 * The caller is responsible for updating the shadow page tables.
     571 * 
     572 * @param   pVM         The VM handle.
     573 * @param   pPage       The page to write monitor.
     574 * @param   GCPhysPage  The address of the page.
     575 */
     576DECLINLINE(void) pgmPhysPageWriteMonitor(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhysPage)
     577{
     578    Assert(PGM_PAGE_GET_STATE(pPage) == PGM_PAGE_STATE_ALLOCATED);
     579    Assert(PGMIsLockOwner(pVM));
     580
     581    PGM_PAGE_SET_STATE(pPage, PGM_PAGE_STATE_WRITE_MONITORED);
     582    pVM->pgm.s.cMonitoredPages++;
     583
     584    /* Large pages must disabled. */
     585    if (PGM_PAGE_GET_PDE_TYPE(pPage) == PGM_PAGE_PDE_TYPE_PDE)
     586    {
     587        PPGMPAGE pFirstPage = pgmPhysGetPage(&pVM->pgm.s, GCPhysPage & X86_PDE2M_PAE_PG_MASK);
     588        AssertFatal(pFirstPage);
     589        if (PGM_PAGE_GET_PDE_TYPE(pFirstPage) == PGM_PAGE_PDE_TYPE_PDE)
     590        {
     591            PGM_PAGE_SET_PDE_TYPE(pFirstPage, PGM_PAGE_PDE_TYPE_PDE_DISABLED);
     592            pVM->pgm.s.cLargePagesDisabled++;
     593        }
     594        else
     595            Assert(PGM_PAGE_GET_PDE_TYPE(pFirstPage) == PGM_PAGE_PDE_TYPE_PDE_DISABLED);
     596    }
     597}
    565598
    566599
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r35696 r36009  
    32133213    uint32_t                        cMappedChunks;      /**< Number of times we mapped a chunk. */
    32143214    uint32_t                        cUnmappedChunks;    /**< Number of times we unmapped a chunk. */
     3215    uint32_t                        cLargePages;        /**< The number of large pages. */
     3216    uint32_t                        cLargePagesDisabled;/**< The number of disabled large pages. */
    32153217/*    uint32_t                        aAlignment4[1]; */
    32163218
     
    32183220    STAMCOUNTER                     cRelocations;
    32193221
    3220     STAMCOUNTER                     StatLargePageAlloc;                 /**< The number of large pages we've allocated.*/
    32213222    STAMCOUNTER                     StatLargePageReused;                /**< The number of large pages we've reused.*/
    32223223    STAMCOUNTER                     StatLargePageRefused;               /**< The number of times we couldn't use a large page.*/
     
    37663767int             pgmPhysAllocPage(PVM pVM, PPGMPAGE pPage, RTGCPHYS GCPhys);
    37673768int             pgmPhysAllocLargePage(PVM pVM, RTGCPHYS GCPhys);
    3768 int             pgmPhysIsValidLargePage(PVM pVM, RTGCPHYS GCPhys, PPGMPAGE pLargePage);
     3769int             pgmPhysRecheckLargePage(PVM pVM, RTGCPHYS GCPhys, PPGMPAGE pLargePage);
    37693770int             pgmPhysPageLoadIntoTlb(PPGM pPGM, RTGCPHYS GCPhys);
    37703771int             pgmPhysPageLoadIntoTlbWithPage(PPGM pPGM, PPGMPAGE pPage, RTGCPHYS GCPhys);
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