VirtualBox

Changeset 17556 in vbox for trunk


Ignore:
Timestamp:
Mar 9, 2009 9:46:40 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43995
Message:

Allow pgm pool flushing only in ring 3. Deal with shadow mode reinit there as well.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r17529 r17556  
    22412241        if (RT_SUCCESS(rc))
    22422242        {
    2243 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    2244             /* Force a shadow mode reinit (necessary for nested paging and ept). */
    2245             pVM->pgm.s.enmShadowMode = PGMMODE_INVALID;
    2246 #endif
    22472243            /*
    22482244             * Switch mode back to real mode.
  • trunk/src/VBox/VMM/PGMShw.h

    r17493 r17556  
    191191
    192192    Assert(HWACCMIsNestedPagingActive(pVM));
     193    Assert(!pVM->pgm.s.pShwPageCR3R3);
    193194
    194195    int rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_ROOT_NESTED, PGMPOOL_IDX_NESTED_ROOT, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3);
     
    246247PGM_SHW_DECL(int, Exit)(PVM pVM)
    247248{
    248 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY
     249#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     250    if (pVM->pgm.s.CTX_SUFF(pShwPageCR3))
     251    {
     252        PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     253
     254        Assert(pVM->pgm.s.iShwUser == PGMPOOL_IDX_NESTED_ROOT);
     255
     256        /* Mark the page as unlocked; allow flushing again. */
     257        pgmPoolUnlockPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     258
     259        pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), pVM->pgm.s.iShwUser, pVM->pgm.s.iShwUserTable);
     260        pVM->pgm.s.pShwPageCR3R3 = 0;
     261        pVM->pgm.s.pShwPageCR3R0 = 0;
     262        pVM->pgm.s.pShwPageCR3RC = 0;
     263        pVM->pgm.s.iShwUser      = 0;
     264        pVM->pgm.s.iShwUserTable = 0;
     265    }
     266#else
    249267# if PGM_SHW_TYPE == PGM_TYPE_NESTED
    250268    Assert(HWACCMIsNestedPagingActive(pVM));
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r17509 r17556  
    41564156#endif /* PGMPOOL_WITH_USER_TRACKING */
    41574157
     4158
     4159#ifdef IN_RING3
    41584160/**
    41594161 * Flushes all the special root pages as part of a pgmPoolFlushAllInt operation.
     
    42564258    /* Unmap the old CR3 value before flushing everything. */
    42574259    int rc = PGM_BTH_PFN(UnmapCR3, pVM)(pVM);
     4260    AssertRC(rc);
     4261
     4262    /* Exit the current shadow paging mode as well; nested paging and EPT use a root CR3 which will get flushed here. */
     4263    rc = PGM_SHW_PFN(Exit, pVM)(pVM);
    42584264    AssertRC(rc);
    42594265#endif
     
    44034409    }
    44044410
     4411#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     4412    /* Force a shadow mode reinit (necessary for nested paging and ept). */
     4413    pVM->pgm.s.enmShadowMode = PGMMODE_INVALID;
     4414
     4415    /* Reinit the current shadow paging mode as well; nested paging and EPT use a root CR3 which will get flushed here. */
     4416    rc = PGMR3ChangeMode(pVM, PGMGetGuestMode(pVM));
     4417    AssertRC(rc);
     4418#endif
     4419
    44054420    /*
    44064421     * Finally, assert the FF.
     
    44104425    STAM_PROFILE_STOP(&pPool->StatFlushAllInt, a);
    44114426}
    4412 
     4427#endif /* IN_RING3 */
    44134428
    44144429/**
     
    47814796}
    47824797
    4783 
     4798#ifdef IN_RING3
    47844799/**
    47854800 * Flushes the entire cache.
     
    47954810    pgmPoolFlushAllInt(pVM->pgm.s.CTX_SUFF(pPool));
    47964811}
     4812#endif
    47974813
    47984814#ifdef LOG_ENABLED
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