VirtualBox

Changeset 17558 in vbox


Ignore:
Timestamp:
Mar 9, 2009 9:52:37 AM (16 years ago)
Author:
vboxsync
Message:

Fixed shadow mode reinit (again)

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

Legend:

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

    r17557 r17558  
    191191
    192192    Assert(HWACCMIsNestedPagingActive(pVM));
    193     Assert(!pVM->pgm.s.pShwPageCR3R3);
     193
     194    /* Free the old CR3 root. */
     195    if (pVM->pgm.s.CTX_SUFF(pShwPageCR3))
     196    {
     197        PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     198
     199        /* Mark the page as unlocked; allow flushing again. */
     200        pgmPoolUnlockPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     201
     202        pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), pVM->pgm.s.iShwUser, pVM->pgm.s.iShwUserTable);
     203        pVM->pgm.s.pShwPageCR3R3 = 0;
     204        pVM->pgm.s.pShwPageCR3R0 = 0;
     205        pVM->pgm.s.pShwPageCR3RC = 0;
     206        pVM->pgm.s.iShwUser      = 0;
     207        pVM->pgm.s.iShwUserTable = 0;
     208    }
    194209
    195210    int rc = pgmPoolAlloc(pVM, GCPhysCR3, PGMPOOLKIND_ROOT_NESTED, PGMPOOL_IDX_NESTED_ROOT, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3);
     
    247262PGM_SHW_DECL(int, Exit)(PVM pVM)
    248263{
    249 #if PGM_SHW_TYPE == PGM_TYPE_NESTED
    250 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    251     if (pVM->pgm.s.CTX_SUFF(pShwPageCR3))
    252     {
    253         PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
    254 
    255         Assert(pVM->pgm.s.iShwUser == PGMPOOL_IDX_NESTED_ROOT);
    256 
    257         /* Mark the page as unlocked; allow flushing again. */
    258         pgmPoolUnlockPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    259 
    260         pgmPoolFreeByPage(pPool, pVM->pgm.s.CTX_SUFF(pShwPageCR3), pVM->pgm.s.iShwUser, pVM->pgm.s.iShwUserTable);
    261         pVM->pgm.s.pShwPageCR3R3 = 0;
    262         pVM->pgm.s.pShwPageCR3R0 = 0;
    263         pVM->pgm.s.pShwPageCR3RC = 0;
    264         pVM->pgm.s.iShwUser      = 0;
    265         pVM->pgm.s.iShwUserTable = 0;
    266     }
    267 # else
     264#ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY
     265# if PGM_SHW_TYPE == PGM_TYPE_NESTED
    268266    Assert(HWACCMIsNestedPagingActive(pVM));
    269267    pVM->pgm.s.pShwRootR3 = 0;
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r17556 r17558  
    42594259    int rc = PGM_BTH_PFN(UnmapCR3, pVM)(pVM);
    42604260    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);
    4264     AssertRC(rc);
    42654261#endif
    42664262
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