VirtualBox

Changeset 86461 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Oct 6, 2020 4:40:59 PM (4 years ago)
Author:
vboxsync
Message:

VMM/PGM: Don't check for, or even define, PGM_PDFLAGS_MAPPING when PGM_WITHOUT_MAPPINGS is active (the default now).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r86458 r86461  
    11931193        Assert(     PdeSrc.n.u1User == PdeDst.n.u1User
    11941194               &&   (PdeSrc.n.u1Write || !PdeDst.n.u1Write || pVCpu->pgm.s.cNetwareWp0Hacks > 0));
    1195 # ifndef PGM_WITHOUT_MAPPING
     1195# ifndef PGM_WITHOUT_MAPPINGS
    11961196        if (PdeDst.u & PGM_PDFLAGS_MAPPING)
    11971197        {
     
    12041204        }
    12051205        else
    1206 # endif /* !PGM_WITHOUT_MAPPING */
     1206# endif /* !PGM_WITHOUT_MAPPINGS */
    12071207        if (!fIsBigPage)
    12081208        {
     
    13021302         * Page directory is not present, mark shadow PDE not present.
    13031303         */
     1304# ifndef PGM_WITHOUT_MAPPINGS
    13041305        if (!(PdeDst.u & PGM_PDFLAGS_MAPPING))
     1306# endif
    13051307        {
    13061308            pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst);
     
    13091311            PGM_INVL_PG(pVCpu, GCPtrPage);
    13101312        }
     1313# ifndef PGM_WITHOUT_MAPPINGS
    13111314        else
    13121315        {
     
    13141317            STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePagePDMappings));
    13151318        }
     1319# endif
    13161320    }
    13171321    return rc;
     
    29842988    SHWPDE          PdeDst = *pPdeDst;
    29852989
     2990# ifndef PGM_WITHOUT_MAPPINGS
    29862991    Assert(!(PdeDst.u & PGM_PDFLAGS_MAPPING));
     2992# endif
    29872993    Assert(!PdeDst.n.u1Present); /* We're only supposed to call SyncPT on PDE!P and conflicts.*/
    29882994
     
    32473253        PdeDst = pPDDst->a[iPDDst];
    32483254# endif
     3255# ifndef PGM_WITHOUT_MAPPINGS
    32493256        if (!(PdeDst.u & PGM_PDFLAGS_MAPPING))
     3257# endif
    32503258        {
    32513259            if (!PdeDst.n.u1Present)
     
    37813789                const SHWPDE PdeDst = pPDDst->a[iPDDst];
    37823790#  endif
     3791#  ifndef PGM_WITHOUT_MAPPINGS
    37833792                if (PdeDst.u & PGM_PDFLAGS_MAPPING)
    37843793                {
     
    37913800                    }
    37923801                }
    3793                 else if (   (PdeDst.u & X86_PDE_P)
    3794                         || ((PdeDst.u & (X86_PDE_P | PGM_PDFLAGS_TRACK_DIRTY)) == (X86_PDE_P | PGM_PDFLAGS_TRACK_DIRTY))
    3795                         )
     3802                else
     3803#  endif
     3804                if (   (PdeDst.u & X86_PDE_P)
     3805                    || ((PdeDst.u & (X86_PDE_P | PGM_PDFLAGS_TRACK_DIRTY)) == (X86_PDE_P | PGM_PDFLAGS_TRACK_DIRTY)) )
    37963806                {
    37973807                    HCPhysShw = PdeDst.u & SHW_PDE_PG_MASK;
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r82968 r86461  
    482482                uShw.pv = PGMPOOL_PAGE_2_PTR(pVM, pPage);
    483483                const unsigned iShw = off / sizeof(X86PDEPAE);
     484#ifndef PGM_WITHOUT_MAPPINGS
    484485                Assert(!(uShw.pPDPae->a[iShw].u & PGM_PDFLAGS_MAPPING));
     486#endif
    485487                if (uShw.pPDPae->a[iShw].n.u1Present)
    486488                {
     
    499501                    AssertBreak(iShw2 < RT_ELEMENTS(uShw.pPDPae->a));
    500502
     503#ifndef PGM_WITHOUT_MAPPINGS
    501504                    Assert(!(uShw.pPDPae->a[iShw2].u & PGM_PDFLAGS_MAPPING));
     505#endif
    502506                    if (uShw.pPDPae->a[iShw2].n.u1Present)
    503507                    {
     
    38033807        case PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD:
    38043808            Assert(iUserTable < X86_PG_PAE_ENTRIES);
     3809#ifndef PGM_WITHOUT_MAPPINGS
    38053810            Assert(!(u.pau64[iUserTable] & PGM_PDFLAGS_MAPPING));
     3811#endif
    38063812            break;
    38073813        case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:
     
    44854491    {
    44864492        if (    pShwPD->a[i].n.u1Present
     4493#ifndef PGM_WITHOUT_MAPPINGS
    44874494            &&  !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING)
     4495#endif
    44884496           )
    44894497        {
     
    45104518    {
    45114519        if (   pShwPD->a[i].n.u1Present
    4512             && !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING))
     4520#ifndef PGM_WITHOUT_MAPPINGS
     4521            && !(pShwPD->a[i].u & PGM_PDFLAGS_MAPPING)
     4522#endif
     4523           )
    45134524        {
    45144525#ifdef PGM_WITH_LARGE_PAGES
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r86453 r86461  
    344344
    345345# elif PGM_SHW_TYPE == PGM_TYPE_EPT
    346     const unsigned  iPd = ((GCPtr >> SHW_PD_SHIFT) & SHW_PD_MASK);
    347346    PEPTPD          pPDDst;
    348     EPTPDE          Pde;
    349 
    350347    int rc = pgmShwGetEPTPDPtr(pVCpu, GCPtr, NULL, &pPDDst);
    351     if (rc != VINF_SUCCESS) /** @todo this function isn't expected to return informational status codes. Check callers / fix. */
     348    if (rc == VINF_SUCCESS) /** @todo this function isn't expected to return informational status codes. Check callers / fix. */
     349    { /* likely */ }
     350    else
    352351    {
    353352        AssertRC(rc);
     
    355354    }
    356355    Assert(pPDDst);
    357     Pde = pPDDst->a[iPd];
     356
     357    const unsigned  iPd = ((GCPtr >> SHW_PD_SHIFT) & SHW_PD_MASK);
     358    EPTPDE Pde = pPDDst->a[iPd];
    358359
    359360# elif PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT
    360361    X86PDE          Pde = pgmShwGet32BitPDE(pVCpu, GCPtr);
     362
    361363# else
    362364#  error "Misconfigured PGM_SHW_TYPE or something..."
     
    396398     */
    397399    PSHWPT          pPT;
     400# ifndef PGM_WITHOUT_MAPPINGS
    398401    if (!(Pde.u & PGM_PDFLAGS_MAPPING))
     402# endif
    399403    {
    400404        int rc2 = PGM_HCPHYS_2_PTR(pVM, pVCpu, Pde.u & SHW_PDE_PG_MASK, &pPT);
     
    402406            return rc2;
    403407    }
     408# ifndef PGM_WITHOUT_MAPPINGS
    404409    else /* mapping: */
    405410    {
    406 # if  PGM_SHW_TYPE == PGM_TYPE_AMD64 \
    407   || PGM_SHW_TYPE == PGM_TYPE_EPT \
    408   || defined(PGM_WITHOUT_MAPPINGS)
     411#  if  PGM_SHW_TYPE == PGM_TYPE_AMD64 \
     412    || PGM_SHW_TYPE == PGM_TYPE_EPT \
     413    || defined(PGM_WITHOUT_MAPPINGS)
    409414        AssertFailed(); /* can't happen */
    410415        pPT = NULL;     /* shut up MSC */
    411 # else
     416#  else
    412417        Assert(pgmMapAreMappingsEnabled(pVM));
    413418
    414419        PPGMMAPPING pMap = pgmGetMapping(pVM, (RTGCPTR)GCPtr);
    415420        AssertMsgReturn(pMap, ("GCPtr=%RGv\n", GCPtr), VERR_PGM_MAPPING_IPE);
    416 if PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT
     421 if PGM_SHW_TYPE == PGM_TYPE_32BIT || PGM_SHW_TYPE == PGM_TYPE_NESTED_32BIT
    417422        pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTX_SUFF(pPT);
    418 else /* PAE */
     423 else /* PAE */
    419424        pPT = pMap->aPTs[(GCPtr - pMap->GCPtr) >> X86_PD_SHIFT].CTX_SUFF(paPaePTs);
     425#   endif
    420426#  endif
    421 # endif
    422427    }
     428# endif /* !PGM_WITHOUT_MAPPINGS */
    423429    const unsigned  iPt = (GCPtr >> SHW_PT_SHIFT) & SHW_PT_MASK;
    424430    SHWPTE          Pte = pPT->a[iPt];
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