VirtualBox

Changeset 11416 in vbox


Ignore:
Timestamp:
Aug 14, 2008 8:34:45 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34732
Message:

InvalidatePage: check 4 PDPEs for PAE guest mode. (shouldn't be necessary though)

File:
1 edited

Legend:

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

    r11407 r11416  
    883883    PX86PDEPAE      pPdeDst   = &pVM->pgm.s.CTXMID(ap,PaePDs[0])->a[iPDDst];
    884884    PX86PDPT        pPdptDst  = pVM->pgm.s.CTXMID(p,PaePDPT);   NOREF(pPdptDst);
     885
     886    /* If the shadow PDPE isn't present, then skip the invalidate. */
     887    if (!pPdptDst->a[iPdpte].n.u1Present)
     888    {
     889        Assert(!(pPdptDst->a[iPdpte].u & PGM_PLXFLAGS_MAPPING));
     890        STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePageSkipped));
     891        return VINF_SUCCESS;
     892    }
     893
    885894# else /* PGM_SHW_TYPE == PGM_TYPE_AMD64 */
    886895    /* PML4 */
     
    935944#  if PGM_GST_TYPE == PGM_TYPE_PAE
    936945    PX86PDPAE       pPDSrc      = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtrPage, &iPDSrc);
     946    X86PDPE         PdpeSrc     = CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[iPdpte];
    937947#  else /* AMD64 */
    938948    PX86PML4E       pPml4eSrc;
     
    10691079
    10701080# if PGM_GST_TYPE == PGM_TYPE_PAE
    1071 
     1081    /* Note: This shouldn't actually be necessary as we monitor the PDPT page for changes. */
     1082    if (!pPDSrc)
     1083    {
     1084        /* Guest PDPE not present */
     1085        PX86PDPAE  pPDPAE  = pVM->pgm.s.CTXMID(ap,PaePDs)[0]; /* root of the 2048 PDE array */
     1086        PX86PDEPAE pPDEDst = &pPDPAE->a[iPdpte * X86_PG_PAE_ENTRIES];
     1087        PPGMPOOL   pPool   = pVM->pgm.s.CTXSUFF(pPool);
     1088
     1089        Assert(!(CTXSUFF(pVM->pgm.s.pGstPaePDPT)->a[iPdpte].n.u1Present));
     1090        LogFlow(("InvalidatePage: guest PDPE %d not present; clear shw pdpe\n", iPdpte));
     1091            /* for each page directory entry */
     1092            for (unsigned iPD = 0; iPD < X86_PG_PAE_ENTRIES; iPD++)
     1093            {
     1094                if (   pPDEDst[iPD].n.u1Present
     1095                    && !(pPDEDst[iPD].u & PGM_PDFLAGS_MAPPING))
     1096                {
     1097                pgmPoolFreeByPage(pPool, pgmPoolGetPage(pPool, pPDEDst[iPD].u & SHW_PDE_PG_MASK), SHW_POOL_ROOT_IDX, iPdpte * X86_PG_PAE_ENTRIES + iPD);
     1098                pPDEDst[iPD].u = 0;
     1099                }
     1100            }
     1101        if (!(pPdptDst->a[iPdpte].u & PGM_PLXFLAGS_MAPPING))
     1102                pPdptDst->a[iPdpte].n.u1Present = 0;
     1103        PGM_INVL_GUEST_TLBS();
     1104    }
     1105    Assert((PdpeSrc.u & X86_PDPE_PG_MASK) == pVM->pgm.s.aGCPhysGstPaePDsMonitored[iPdpte]);
    10721106# endif
    10731107
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