VirtualBox

Changeset 93593 in vbox for trunk/src/VBox/VMM/VMMR3/PGM.cpp


Ignore:
Timestamp:
Feb 3, 2022 9:05:05 PM (3 years ago)
Author:
vboxsync
Message:

VMM: Embedded the zero and mmio-dummy pages into the VM structure and realigned it for a 16384 page size. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r93554 r93593  
    930930
    931931    /*
    932      * Allocate the zero page.
    933      */
    934     if (RT_SUCCESS(rc))
    935     {
    936         rc = MMHyperAlloc(pVM, RT_MAX(GUEST_PAGE_SIZE, HOST_PAGE_SIZE), GUEST_PAGE_SIZE, MM_TAG_PGM, &pVM->pgm.s.pvZeroPgR3);
    937         if (RT_SUCCESS(rc))
    938         {
    939             pVM->pgm.s.pvZeroPgR0 = MMHyperR3ToR0(pVM, pVM->pgm.s.pvZeroPgR3);
    940             pVM->pgm.s.HCPhysZeroPg = !fDriverless ? MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.pvZeroPgR3)
    941                                     : _4G - GUEST_PAGE_SIZE * 2 /* fake to avoid PGM_PAGE_INIT_ZERO assertion */;
    942             AssertRelease(pVM->pgm.s.HCPhysZeroPg != NIL_RTHCPHYS);
    943         }
    944     }
    945 
    946     /*
    947      * Allocate the invalid MMIO page.
     932     * Setup the zero page.
     933     */
     934    RT_ZERO(pVM->pgm.s.abZeroPg);
     935    pVM->pgm.s.HCPhysZeroPg = !fDriverless ? MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.abZeroPg)
     936                            : _4G - GUEST_PAGE_SIZE * 2 /* fake to avoid PGM_PAGE_INIT_ZERO assertion */;
     937    AssertRelease(pVM->pgm.s.HCPhysZeroPg != NIL_RTHCPHYS);
     938
     939    /*
     940     * Setup the invalid MMIO page.
    948941     * (The invalid bits in HCPhysInvMmioPg are set later on init complete.)
    949942     */
    950     if (RT_SUCCESS(rc))
    951     {
    952         rc = MMHyperAlloc(pVM, RT_MAX(GUEST_PAGE_SIZE, HOST_PAGE_SIZE), GUEST_PAGE_SIZE,
    953                           MM_TAG_PGM, &pVM->pgm.s.pvMmioPgR3);
    954         if (RT_SUCCESS(rc))
    955         {
    956             ASMMemFill32(pVM->pgm.s.pvMmioPgR3, RT_MAX(GUEST_PAGE_SIZE, HOST_PAGE_SIZE), 0xfeedface);
    957             pVM->pgm.s.HCPhysMmioPg = !fDriverless ? MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.pvMmioPgR3)
    958                                     : _4G - GUEST_PAGE_SIZE * 3 /* fake to avoid PGM_PAGE_INIT_ZERO assertion */;
    959             AssertRelease(pVM->pgm.s.HCPhysMmioPg != NIL_RTHCPHYS);
    960             pVM->pgm.s.HCPhysInvMmioPg = pVM->pgm.s.HCPhysMmioPg;
    961         }
    962     }
     943    ASMMemFill32(pVM->pgm.s.abMmioPg, sizeof(pVM->pgm.s.abMmioPg), 0xfeedface);
     944    pVM->pgm.s.HCPhysMmioPg = !fDriverless ? MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.abMmioPg)
     945                            : _4G - GUEST_PAGE_SIZE * 3 /* fake to avoid PGM_PAGE_INIT_ZERO assertion */;
     946    AssertRelease(pVM->pgm.s.HCPhysMmioPg != NIL_RTHCPHYS);
     947    pVM->pgm.s.HCPhysInvMmioPg = pVM->pgm.s.HCPhysMmioPg;
    963948
    964949    /*
     
    17731758
    17741759    /*
    1775      * The Zero page.
    1776      */
    1777     pVM->pgm.s.pvZeroPgR0 = MMHyperR3ToR0(pVM, pVM->pgm.s.pvZeroPgR3);
    1778     AssertRelease(pVM->pgm.s.pvZeroPgR0 != NIL_RTR0PTR || SUPR3IsDriverless());
    1779 
    1780     /*
    17811760     * The page pool.
    17821761     */
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