VirtualBox

Changeset 26635 in vbox for trunk


Ignore:
Timestamp:
Feb 18, 2010 6:24:40 PM (15 years ago)
Author:
vboxsync
Message:

PAE and AMD64 paging modes support large pages regardless of CR4.PSE.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r26026 r26635  
    17211721VMMDECL(bool) CPUMIsGuestPageSizeExtEnabled(PVMCPU pVCpu)
    17221722{
     1723    /* PAE or AMD64 implies support for big pages regardless of CR4.PSE */
     1724    if (pVCpu->cpum.s.Guest.cr4 & X86_CR4_PAE)
     1725        return true;
     1726
    17231727    return !!(pVCpu->cpum.s.Guest.cr4 & X86_CR4_PSE);
    17241728}
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r26625 r26635  
    376376#  if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE)
    377377        if (    PdeSrc.b.u1Size
    378 #   if PGM_GST_TYPE != PGM_TYPE_AMD64
     378#   if PGM_GST_TYPE == PGM_TYPE_32BIT
    379379            &&  CPUMIsGuestPageSizeExtEnabled(pVCpu)
    380380#   endif
     
    10951095# endif /* PGM_GST_TYPE != PGM_TYPE_32BIT */
    10961096
    1097 # if PGM_GST_TYPE == PGM_TYPE_AMD64
     1097# if PGM_GST_TYPE == PGM_TYPE_32BIT
     1098    const bool      fIsBigPage  = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
     1099# else
    10981100    const bool      fIsBigPage  = PdeSrc.b.u1Size;
    1099 # else
    1100     const bool      fIsBigPage  = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
    11011101# endif
    11021102
     
    16391639     * Check that the page is present and that the shadow PDE isn't out of sync.
    16401640     */
    1641 # if PGM_GST_TYPE == PGM_TYPE_AMD64
     1641# if PGM_GST_TYPE == PGM_TYPE_32BIT
     1642    const bool      fBigPage = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
     1643# else
    16421644    const bool      fBigPage = PdeSrc.b.u1Size;
    1643 # else
    1644     const bool      fBigPage = PdeSrc.b.u1Size && CPUMIsGuestPageSizeExtEnabled(pVCpu);
    16451645# endif
    16461646    RTGCPHYS        GCPhys;
     
    20992099     */
    21002100    if (   pPdeSrc->b.u1Size
    2101 #  if PGM_GST_TYPE != PGM_TYPE_AMD64
     2101#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    21022102        && CPUMIsGuestPageSizeExtEnabled(pVCpu)
    21032103#  endif
     
    22062206        /* Check the present bit as the shadow tables can cause different error codes by being out of sync. */
    22072207        if (   pPdeSrc->b.u1Size
    2208 #  if PGM_GST_TYPE != PGM_TYPE_AMD64
     2208#  if PGM_GST_TYPE == PGM_TYPE_32BIT
    22092209            && CPUMIsGuestPageSizeExtEnabled(pVCpu)
    22102210#  endif
     
    22442244PGM_BTH_DECL(int, CheckDirtyPageFault)(PVMCPU pVCpu, uint32_t uErr, PSHWPDE pPdeDst, PGSTPDE pPdeSrc, RTGCPTR GCPtrPage)
    22452245{
    2246 # if PGM_GST_TYPE == PGM_TYPE_AMD64
     2246# if PGM_GST_TYPE == PGM_TYPE_32BIT
     2247    const bool fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu);
     2248# else
    22472249    const bool fBigPagesSupported = true;
    2248 # else
    2249     const bool fBigPagesSupported = !!(CPUMGetGuestCR4(pVCpu) & X86_CR4_PSE);
    22502250# endif
    22512251    PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    25262526         */
    25272527        PSHWPT          pPTDst;
    2528 # if PGM_GST_TYPE == PGM_TYPE_AMD64
     2528# if PGM_GST_TYPE == PGM_TYPE_32BIT
     2529        const bool      fPageTable = !PdeSrc.b.u1Size || !CPUMIsGuestPageSizeExtEnabled(pVCpu);
     2530# else
    25292531        const bool      fPageTable = !PdeSrc.b.u1Size;
    2530 # else
    2531         const bool      fPageTable = !PdeSrc.b.u1Size || !CPUMIsGuestPageSizeExtEnabled(pVCpu);
    25322532# endif
    25332533        PPGMPOOLPAGE    pShwPage;
     
    34783478    || PGM_GST_TYPE == PGM_TYPE_AMD64
    34793479
    3480 # if PGM_GST_TYPE == PGM_TYPE_AMD64
     3480# if PGM_GST_TYPE == PGM_TYPE_32BIT
     3481    bool            fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu);
     3482# else
    34813483    bool            fBigPagesSupported = true;
    3482 # else
    3483     bool            fBigPagesSupported = CPUMIsGuestPageSizeExtEnabled(pVCpu);
    34843484# endif
    34853485    PPGMCPU         pPGM = &pVCpu->pgm.s;
  • trunk/src/VBox/VMM/VMMAll/PGMAllGst.h

    r25866 r26635  
    104104
    105105    if (    !Pde.b.u1Size
    106 # if PGM_GST_TYPE != PGM_TYPE_AMD64
     106# if PGM_GST_TYPE == PGM_TYPE_32BIT
    107107        ||  !CPUMIsGuestPageSizeExtEnabled(pVCpu)
    108108# endif
     
    221221
    222222        if (    !Pde.b.u1Size
    223 # if PGM_GST_TYPE != PGM_TYPE_AMD64
     223# if PGM_GST_TYPE == PGM_TYPE_32BIT
    224224            ||  !CPUMIsGuestPageSizeExtEnabled(pVCpu)
    225225# endif
     
    362362        {
    363363            if (    !Pde.b.u1Size
    364 # if PGM_GST_TYPE != PGM_TYPE_AMD64
     364# if PGM_GST_TYPE == PGM_TYPE_32BIT
    365365                ||  !(pState->cr4 & X86_CR4_PSE)
    366366# endif
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