VirtualBox

儲存庫 vbox 的更動 17134


忽略:
時間撮記:
2009-2-25 下午03:10:11 (16 年 以前)
作者:
vboxsync
訊息:

VBOX_WITH_PGMPOOL_PAGING_ONLY: updates

位置:
trunk
檔案:
修改 7 筆資料

圖例:

未更動
新增
刪除
  • trunk/include/VBox/pgm.h

    r17058 r17134  
    329329VMMDECL(int)        PGMMapSetPage(PVM pVM, RTGCPTR GCPtr, uint64_t cb, uint64_t fFlags);
    330330VMMDECL(int)        PGMMapModifyPage(PVM pVM, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask);
    331 VMMDECL(int)        PGMMapActivateAll(PVM pVM);
    332 VMMDECL(int)        PGMMapDeactivateAll(PVM pVM);
    333331#ifndef IN_RING0
    334332VMMDECL(bool)       PGMMapHasConflicts(PVM pVM);
  • trunk/src/VBox/VMM/PGMBth.h

    r16864 r17134  
    149149    {
    150150        /* Remove the hypervisor mappings from the shadow page table. */
    151         PGMMapDeactivateAll(pVM);
     151        pgmMapDeactivateCR3(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    152152
    153153        /* It might have been freed already by a pool flush (see e.g. PGMR3MappingsUnfix). */
     
    192192
    193193    /* Apply all hypervisor mappings to the new CR3. */
    194     return PGMMapActivateAll(pVM);
     194    return pgmMapActivateCR3(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    195195# endif
    196196#else
  • trunk/src/VBox/VMM/PGMInternal.h

    r17057 r17134  
    29862986void            pgmMapClearShadowPDEs(PVM pVM, PPGMPOOLPAGE pShwPageCR3, PPGMMAPPING pMap, unsigned iOldPDE);
    29872987void            pgmMapSetShadowPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE);
     2988int             pgmShwSyncPaePDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD);
     2989#endif
    29882990int             pgmMapDeactivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3);
    2989 int             pgmShwSyncPaePDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD);
    2990 #endif
     2991int             pgmMapActivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3);
     2992
    29912993#ifndef IN_RC
    29922994int             pgmShwSyncLongModePDPtr(PVM pVM, RTGCPTR64 GCPtr, PX86PML4E pGstPml4e, PX86PDPE pGstPdpe, PX86PDPAE *ppPD);
  • trunk/src/VBox/VMM/PGMMap.cpp

    r16889 r17134  
    652652    AssertRCReturn(rc, rc);
    653653
    654     rc = PGMMapDeactivateAll(pVM);
     654    rc = pgmMapDeactivateCR3(pVM, pVM->pgm.s.pShwPageCR3R3);
    655655    AssertRCReturn(rc, rc);
    656656
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r17059 r17134  
    21932193    register unsigned iPage = pVM->pgm.s.iDynPageMapLast;
    21942194#  ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    2195     for (unsigned i=0;i<(MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT);i++)
     2195    unsigned i;
     2196    for (i=0;i<(MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT);i++)
    21962197    {
    21972198        pVM->pgm.s.iDynPageMapLast = iPage = (iPage + 1) & ((MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT) - 1);
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r17059 r17134  
    46434643    uint32_t     iOldShwUserTable  = pVM->pgm.s.iShwUserTable;
    46444644    uint32_t     iOldShwUser       = pVM->pgm.s.iShwUser;
     4645    PPGMPOOLPAGE pNewShwPageCR3;
    46454646
    46464647    Assert(!(GCPhysCR3 >> (PAGE_SHIFT + 32)));
    4647     rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, &pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     4648    rc = pgmPoolAlloc(pVM, GCPhysCR3 & GST_CR3_PAGE_MASK, BTH_PGMPOOLKIND_ROOT, SHW_POOL_ROOT_IDX, GCPhysCR3 >> PAGE_SHIFT, &pNewShwPageCR3);
    46484649    if (rc == VERR_PGM_POOL_FLUSHED)
    46494650    {
    46504651        Log(("MapCR3: PGM pool flushed -> signal sync cr3\n"));
    4651         pVM->pgm.s.CTX_SUFF(pShwPageCR3) = pOldShwPageCR3;
    46524652        Assert(VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3));
    46534653        return VINF_PGM_SYNC_CR3;
     
    46554655    AssertRCReturn(rc, rc);
    46564656    rc = VINF_SUCCESS;
     4657
    46574658    pVM->pgm.s.iShwUser      = SHW_POOL_ROOT_IDX;
    46584659    pVM->pgm.s.iShwUserTable = GCPhysCR3 >> PAGE_SHIFT;
     4660    pVM->pgm.s.CTX_SUFF(pShwPageCR3) = pNewShwPageCR3;
    46594661#  ifdef IN_RING0
    46604662    pVM->pgm.s.pShwPageCR3R3 = MMHyperCCToR3(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     
    46824684    Assert(VM_FF_ISSET(pVM, VM_FF_PGM_SYNC_CR3_NON_GLOBAL));
    46834685#   endif
    4684     rc = PGMMapActivateAll(pVM);
     4686    rc = pgmMapActivateCR3(pVM, pNewShwPageCR3);
    46854687    AssertRCReturn(rc, rc);
    46864688#  endif
     
    47834785# ifndef PGM_WITHOUT_MAPPINGS
    47844786    /* Remove the hypervisor mappings from the shadow page table. */
    4785     PGMMapDeactivateAll(pVM);
     4787    pgmMapDeactivateCR3(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    47864788# endif
    47874789
  • trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp

    r17124 r17134  
    532532 * @returns VBox status.
    533533 * @param   pVM         The virtual machine.
    534  */
    535 VMMDECL(int) PGMMapActivateAll(PVM pVM)
     534 * @param   pShwPageCR3 CR3 root page
     535 */
     536int pgmMapActivateCR3(PVM pVM, PPGMPOOLPAGE pShwPageCR3)
    536537{
    537538#ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
     
    552553
    553554# ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    554     Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     555    Assert(pShwPageCR3 && pShwPageCR3 == pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    555556# endif
    556557
     
    563564
    564565        pgmMapSetShadowPDEs(pVM, pCur, iPDE);
    565     }
    566     return VINF_SUCCESS;
    567 }
    568 
    569 /**
    570  * Remove the hypervisor mappings from the active CR3
    571  *
    572  * @returns VBox status.
    573  * @param   pVM         The virtual machine.
    574  */
    575 VMMDECL(int) PGMMapDeactivateAll(PVM pVM)
    576 {
    577 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    578     /*
    579      * Can skip this if mappings are disabled.
    580      */
    581     if (!pgmMapAreMappingsEnabled(&pVM->pgm.s))
    582 #else
    583     /*
    584      * Can skip this if mappings are safely fixed.
    585      */
    586     if (pVM->pgm.s.fMappingsFixed)
    587 #endif
    588         return VINF_SUCCESS;
    589 
    590     Log(("PGMMapDeactivateAll fixed mappings=%d\n", pVM->pgm.s.fMappingsFixed));
    591 
    592 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    593     Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3));
    594 # endif
    595 
    596     /*
    597      * Iterate mappings.
    598      */
    599     for (PPGMMAPPING pCur = pVM->pgm.s.CTX_SUFF(pMappings); pCur; pCur = pCur->CTX_SUFF(pNext))
    600     {
    601         unsigned iPDE = pCur->GCPtr >> X86_PD_SHIFT;
    602 
    603         pgmMapClearShadowPDEs(pVM, pVM->pgm.s.CTX_SUFF(pShwPageCR3), pCur, iPDE);
    604566    }
    605567    return VINF_SUCCESS;
     
    630592
    631593# ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY
    632     Assert(pVM->pgm.s.CTX_SUFF(pShwPageCR3));
     594    Assert(pShwPageCR3);
    633595# endif
    634596
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette