VirtualBox

Changeset 10320 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 7, 2008 1:27:57 PM (17 years ago)
Author:
vboxsync
Message:

Rearranged code to deal with pgm pool tasks during SyncCR3.

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

Legend:

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

    r10063 r10320  
    26512651void            pgmPoolFlushAll(PVM pVM);
    26522652void            pgmPoolClearAll(PVM pVM);
     2653int             pgmPoolSyncCR3(PVM pVM);
    26532654void            pgmPoolTrackFlushGCPhysPT(PVM pVM, PPGMPAGE pPhysPage, uint16_t iShw, uint16_t cRefs);
    26542655void            pgmPoolTrackFlushGCPhysPTs(PVM pVM, PPGMPAGE pPhysPage, uint16_t iPhysExt);
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r10319 r10320  
    30163016
    30173017#ifdef PGMPOOL_WITH_MONITORING
    3018     /*
    3019      * When monitoring shadowed pages, we reset the modification counters on CR3 sync.
    3020      * Occationally we will have to clear all the shadow page tables because we wanted
    3021      * to monitor a page which was mapped by too many shadowed page tables. This operation
    3022      * sometimes refered to as a 'lightweight flush'.
    3023      */
    3024     if (!(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL))
    3025         pgmPoolMonitorModifiedClearAll(pVM);
    3026     else
    3027     {
    3028 # ifndef IN_GC
    3029         pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_CLEAR_PGM_POOL;
    3030         pgmPoolClearAll(pVM);
    3031 # else
    3032         LogFlow(("SyncCR3: PGM_SYNC_CLEAR_PGM_POOL is set -> VINF_PGM_SYNC_CR3\n"));
    3033         return VINF_PGM_SYNC_CR3;
    3034 # endif
    3035     }
     3018    int rc = pgmPoolSyncCR3(pVM);
     3019    if (rc != VINF_SUCCESS)
     3020        return rc;
    30363021#endif
    30373022
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r10314 r10320  
    18621862    STAM_PROFILE_STOP(&pPool->StatClearAll, c);
    18631863}
     1864
     1865/**
     1866 * Handle SyncCR3 pool tasks
     1867 *
     1868 * @returns VBox status code.
     1869 * @retval  VINF_SUCCESS if successfully added.
     1870 * @retval  VINF_PGM_SYNC_CR3 is it needs to be deferred to ring 3 (GC only)
     1871 * @param   pVM     The VM handle.
     1872 * @remark  Should only be used when monitoring is available, thus placed in
     1873 *          the PGMPOOL_WITH_MONITORING #ifdef.
     1874 */
     1875int pgmPoolSyncCR3(PVM pVM)
     1876{
     1877    /*
     1878     * When monitoring shadowed pages, we reset the modification counters on CR3 sync.
     1879     * Occasionally we will have to clear all the shadow page tables because we wanted
     1880     * to monitor a page which was mapped by too many shadowed page tables. This operation
     1881     * sometimes refered to as a 'lightweight flush'.
     1882     */
     1883    if (!(pVM->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL))
     1884        pgmPoolMonitorModifiedClearAll(pVM);
     1885    else
     1886    {
     1887# ifndef IN_GC
     1888        pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_CLEAR_PGM_POOL;
     1889        pgmPoolClearAll(pVM);
     1890# else
     1891        LogFlow(("SyncCR3: PGM_SYNC_CLEAR_PGM_POOL is set -> VINF_PGM_SYNC_CR3\n"));
     1892        return VINF_PGM_SYNC_CR3;
     1893# endif
     1894    }
     1895    return VINF_SUCCESS;
     1896}
    18641897#endif /* PGMPOOL_WITH_MONITORING */
    1865 
    18661898
    18671899#ifdef PGMPOOL_WITH_USER_TRACKING
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