VirtualBox

Changeset 7971 in vbox


Ignore:
Timestamp:
Apr 15, 2008 10:12:22 AM (17 years ago)
Author:
vboxsync
Message:

PAE fixes/updates for raw mode (PDPT monitoring)

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

Legend:

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

    r7961 r7971  
    170170 * Never free such an entry. */
    171171#define PGM_PLXFLAGS_PERMANENT      RT_BIT_64(10)
     172/** Mapping (hypervisor allocated pagetable). */
     173#define PGM_PLXFLAGS_MAPPING        RT_BIT_64(11)
    172174/** @} */
    173175
  • trunk/src/VBox/VMM/PGMMap.cpp

    r7905 r7971  
    3636*   Internal Functions                                                         *
    3737*******************************************************************************/
    38 static void              pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, int iOldPDE);
    39 static void              pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, int iNewPDE);
     38static void              pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, unsigned iOldPDE);
     39static void              pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE);
    4040static int               pgmR3MapIntermediateCheckOne(PVM pVM, uintptr_t uAddress, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
    4141static void              pgmR3MapIntermediateDoOne(PVM pVM, uintptr_t uAddress, RTHCPHYS HCPhys, unsigned cPages, PX86PT pPTDefault, PX86PTPAE pPTPaeDefault);
     
    691691 * @param   iOldPDE     The index of the 32-bit PDE corresponding to the base of the mapping.
    692692 */
    693 static void pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, int iOldPDE)
     693static void pgmR3MapClearPDEs(PPGM pPGM, PPGMMAPPING pMap, unsigned iOldPDE)
    694694{
    695695    unsigned i = pMap->cPTs;
     
    708708         * PAE.
    709709         */
    710         const int iPD = iOldPDE / 256;
    711         int iPDE = iOldPDE * 2 % 512;
     710        const unsigned iPD = iOldPDE / 256;
     711        unsigned iPDE = iOldPDE * 2 % 512;
    712712        pPGM->apInterPaePDs[iPD]->a[iPDE].u = 0;
    713713        pPGM->apHCPaePDs[iPD]->a[iPDE].u    = 0;
     
    715715        pPGM->apInterPaePDs[iPD]->a[iPDE].u = 0;
    716716        pPGM->apHCPaePDs[iPD]->a[iPDE].u    = 0;
     717
     718        /* Clear the PGM_PDFLAGS_MAPPING flag for the page directory pointer entry. (legacy PAE guest mode) */
     719        pPGM->pHCPaePDPT->a[iPD].u &= ~PGM_PLXFLAGS_MAPPING;
    717720    }
    718721}
     
    726729 * @param   iNewPDE     The index of the 32-bit PDE corresponding to the base of the mapping.
    727730 */
    728 static void pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, int iNewPDE)
     731static void pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE)
    729732{
    730733    PPGM pPGM = &pVM->pgm.s;
     
    734737        return;
    735738
    736     Assert(PGMGetGuestMode(pVM) <= PGMMODE_32_BIT);
     739    Assert(PGMGetGuestMode(pVM) <= PGMMODE_PAE);
    737740
    738741    /*
     
    759762         * PAE.
    760763         */
    761         const int iPD = iNewPDE / 256;
    762         int iPDE = iNewPDE * 2 % 512;
     764        const unsigned iPD = iNewPDE / 256;
     765        unsigned iPDE = iNewPDE * 2 % 512;
    763766        if (pPGM->apHCPaePDs[iPD]->a[iPDE].n.u1Present)
    764767            pgmPoolFree(pVM, pPGM->apHCPaePDs[iPD]->a[iPDE].u & X86_PDE_PAE_PG_MASK, PGMPOOL_IDX_PAE_PD, iNewPDE * 2);
     
    775778        pPGM->apInterPaePDs[iPD]->a[iPDE] = PdePae1;
    776779        pPGM->apHCPaePDs[iPD]->a[iPDE]    = PdePae1;
     780
     781        /* Set the PGM_PDFLAGS_MAPPING flag in the page directory pointer entry. (legacy PAE guest mode) */
     782        pPGM->pHCPaePDPT->a[iPD].u |= PGM_PLXFLAGS_MAPPING;
    777783    }
    778784}
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r7963 r7971  
    433433                if (iShw < X86_PG_PAE_PDPE_ENTRIES)          /* don't use ELEMENTS(uShw.pPDPT->a), because that's for long mode only */
    434434                {
    435                     if (uShw.pPDPT->a[iShw].u & PGM_PDFLAGS_MAPPING)
     435                    if (uShw.pPDPT->a[iShw].u & PGM_PLXFLAGS_MAPPING)
    436436                    {
    437437                        Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s));
     
    447447                        if (    iShw2 != iShw
    448448                            &&  iShw2 < X86_PG_PAE_PDPE_ENTRIES
    449                             &&  uShw.pPDPT->a[iShw2].u & PGM_PDFLAGS_MAPPING)
     449                            &&  uShw.pPDPT->a[iShw2].u & PGM_PLXFLAGS_MAPPING)
    450450                        {
    451451                            Assert(pgmMapAreMappingsEnabled(&pPool->CTXSUFF(pVM)->pgm.s));
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