VirtualBox

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


Ignore:
Timestamp:
Jul 23, 2010 3:49:30 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64004
Message:

PGM: Prep for shadowing EFER.NXE and CR4.PSE to avoid function calls.

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

Legend:

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

    r31067 r31069  
    406406#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    407407        if (    PdeSrc.b.u1Size
    408 #   if PGM_GST_TYPE == PGM_TYPE_32BIT
    409             &&  CPUMIsGuestPageSizeExtEnabled(pVCpu)
    410 #   endif
    411             )
     408            &&  GST_IS_PSE_ACTIVE(pVCpu))
    412409            GCPhys = GST_GET_PDE_BIG_PG_GCPHYS(pVM, PdeSrc)
    413410                    | ((RTGCPHYS)pvFault & (GST_BIG_PAGE_OFFSET_MASK ^ PAGE_OFFSET_MASK));
     
    11381135        PdeSrc.u = 0;
    11391136# endif /* PGM_GST_TYPE != PGM_TYPE_32BIT */
    1140 
    1141 # if PGM_GST_TYPE == PGM_TYPE_32BIT
    1142     const bool      fIsBigPage  = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
    1143 # else
    1144     const bool      fIsBigPage  = PdeSrc.b.u1Size;
    1145 # endif
     1137    const bool      fIsBigPage  = PdeSrc.b.u1Size && GST_IS_PSE_ACTIVE(pVCpu);
    11461138
    11471139# ifdef IN_RING3
     
    17611753     * Check that the page is present and that the shadow PDE isn't out of sync.
    17621754     */
    1763 # if PGM_GST_TYPE == PGM_TYPE_32BIT
    1764     const bool      fBigPage  = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
    1765 # else
    1766     const bool      fBigPage  = PdeSrc.b.u1Size;
    1767 # endif
     1755    const bool      fBigPage  = PdeSrc.b.u1Size && GST_IS_PSE_ACTIVE(pVCpu);
    17681756    const bool      fPdeValid = !fBigPage ? GST_IS_PDE_VALID(pVCpu, PdeSrc) : GST_IS_BIG_PDE_VALID(pVCpu, PdeSrc);
    17691757    RTGCPHYS        GCPhys;
     
    17901778        &&  (PdeSrc.n.u1Write == PdeDst.n.u1Write || !PdeDst.n.u1Write)
    17911779# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    1792         &&  (PdeSrc.n.u1NoExecute == PdeDst.n.u1NoExecute || !CPUMIsGuestNXEnabled(pVCpu))
     1780        &&  (PdeSrc.n.u1NoExecute == PdeDst.n.u1NoExecute || !GST_IS_NX_ACTIVE(pVCpu))
    17931781# endif
    17941782       )
     
    22612249    bool        fWriteFault          = !!(uErr & X86_TRAP_PF_RW);
    22622250# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    2263     bool        fMaybeNXEFault       =   (uErr & X86_TRAP_PF_ID) && CPUMIsGuestNXEnabled(pVCpu);
     2251    bool        fMaybeNXEFault       =   (uErr & X86_TRAP_PF_ID) && GST_IS_NX_ACTIVE(pVCpu);
    22642252# endif
    22652253    bool        fMaybeWriteProtFault = fWriteFault && (fUserLevelFault || CPUMIsGuestR0WriteProtEnabled(pVCpu));
     
    23372325    if (!pPdeSrc->n.u1Present)
    23382326        return PGM_BTH_NAME(CheckPageFaultReturnNP)(pVCpu, uErr, GCPtrPage, 2);
    2339 # if PGM_GST_TYPE == PGM_TYPE_32BIT
    2340     bool const fBigPage = pPdeSrc->b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
    2341 # else
    2342     bool const fBigPage = pPdeSrc->b.u1Size;
    2343 # endif
     2327    bool const fBigPage = pPdeSrc->b.u1Size && GST_IS_PSE_ACTIVE(pVCpu);
    23442328    if (!fBigPage ? !GST_IS_PDE_VALID(pVCpu, *pPdeSrc) : !GST_IS_BIG_PDE_VALID(pVCpu, *pPdeSrc))
    23452329        return PGM_BTH_NAME(CheckPageFaultReturnRSVD)(pVCpu, uErr, GCPtrPage, 2);
     
    24552439PGM_BTH_DECL(int, CheckDirtyPageFault)(PVMCPU pVCpu, uint32_t uErr, PSHWPDE pPdeDst, PGSTPDE pPdeSrc, RTGCPTR GCPtrPage)
    24562440{
    2457 # if PGM_GST_TYPE == PGM_TYPE_32BIT
    2458     const bool  fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu);
    2459 # else
    2460     const bool  fBigPagesSupported = true;
    2461 # endif
    24622441    PVM         pVM   = pVCpu->CTX_SUFF(pVM);
    24632442    PPGMPOOL    pPool = pVM->pgm.s.CTX_SUFF(pPool);
     
    24682447     * Handle big page.
    24692448     */
    2470     if (pPdeSrc->b.u1Size && fBigPagesSupported)
     2449    if (pPdeSrc->b.u1Size && GST_IS_PSE_ACTIVE(pVCpu))
    24712450    {
    24722451        if (    pPdeDst->n.u1Present
     
    27542733         */
    27552734        PSHWPT          pPTDst;
    2756 # if PGM_GST_TYPE == PGM_TYPE_32BIT
    2757         const bool      fPageTable = !PdeSrc.b.u1Size || !CPUMIsGuestPageSizeExtEnabled(pVCpu);
    2758 # else
    2759         const bool      fPageTable = !PdeSrc.b.u1Size;
    2760 # endif
     2735        const bool      fPageTable = !PdeSrc.b.u1Size || !GST_IS_PSE_ACTIVE(pVCpu);
    27612736        PPGMPOOLPAGE    pShwPage;
    27622737        RTGCPHYS        GCPhys;
     
    27742749            PGMPOOLACCESS enmAccess;
    27752750# if PGM_WITH_NX(PGM_GST_TYPE, PGM_SHW_TYPE)
    2776             const bool fNoExecute = PdeSrc.n.u1NoExecute && CPUMIsGuestNXEnabled(pVCpu);
     2751            const bool fNoExecute = PdeSrc.n.u1NoExecute && GST_IS_NX_ACTIVE(pVCpu);
    27772752# else
    27782753            const bool fNoExecute = false;
     
    37793754    || PGM_GST_TYPE == PGM_TYPE_AMD64
    37803755
    3781 # if PGM_GST_TYPE == PGM_TYPE_32BIT
    3782     bool            fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu);
    3783 # else
    3784     bool            fBigPagesSupported = true;
    3785 # endif
     3756    bool            fBigPagesSupported = GST_IS_PSE_ACTIVE(pVCpu);
    37863757    PPGMCPU         pPGM = &pVCpu->pgm.s;
    37873758    RTGCPHYS        GCPhysGst;              /* page address derived from the guest page tables. */
  • trunk/src/VBox/VMM/VMMAll/PGMAllShw.h

    r30369 r31069  
    213213        {
    214214            *pfFlags = (Pde.u & ~SHW_PDE_PG_MASK);
    215 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE)
     215# if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE)    /** @todo why do we have to check the guest state here? */
    216216            if ((Pde.u & X86_PTE_PAE_NX) && CPUMIsGuestNXEnabled(pVCpu))
    217217                *pfFlags |= X86_PTE_PAE_NX;
     
    266266        *pfFlags = (Pte.u & ~SHW_PTE_PG_MASK)
    267267                 & ((Pde.u & (X86_PTE_RW | X86_PTE_US)) | ~(uint64_t)(X86_PTE_RW | X86_PTE_US));
    268 # if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE)
     268# if PGM_WITH_NX(PGM_SHW_TYPE, PGM_SHW_TYPE) /** @todo why do we have to check the guest state here? */
    269269        /* The NX bit is determined by a bitwise OR between the PT and PD */
    270270        if (((Pte.u | Pde.u) & X86_PTE_PAE_NX) && CPUMIsGuestNXEnabled(pVCpu))
Note: See TracChangeset for help on using the changeset viewer.

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