VirtualBox

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


Ignore:
Timestamp:
Sep 11, 2007 4:30:42 PM (17 years ago)
Author:
vboxsync
Message:

ZeroPg

File:
1 edited

Legend:

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

    r4713 r4714  
    925925        return rc;
    926926
    927     /* Initialise PGM critical section. */
     927    /*
     928     * Initialize the PGM critical section and flush the phys TLBs
     929     */
    928930    rc = PDMR3CritSectInit(pVM, &pVM->pgm.s.CritSect, "PGM");
    929931    AssertRCReturn(rc, rc);
    930932
    931     /*
    932      * Invalidate the TLBs.
    933      */
    934933    PGMR3PhysChunkInvalidateTLB(pVM);
    935934    PGMPhysInvalidatePageR3MapTLB(pVM);
     
    944943    {
    945944        pVM->pgm.s.pTreesGC = MMHyperHC2GC(pVM, pVM->pgm.s.pTreesHC);
     945
     946        /*
     947         * Alocate the zero page.
     948         */
     949        rc = MMHyperAlloc(pVM, PAGE_SIZE, PAGE_SIZE, MM_TAG_PGM, &pVM->pgm.s.pvZeroPgR3);
     950    }
     951    if (VBOX_SUCCESS(rc))
     952    {
     953        pVM->pgm.s.pvZeroPgGC = MMHyperR3ToGC(pVM, pVM->pgm.s.pvZeroPgR3);
     954        pVM->pgm.s.pvZeroPgR0 = MMHyperR3ToR0(pVM, pVM->pgm.s.pvZeroPgR3);
     955        AssertRelease(pVM->pgm.s.pvZeroPgR0 != NIL_RTHCPHYS);
     956        pVM->pgm.s.HCPhysZeroPg = MMR3HyperHCVirt2HCPhys(pVM, pVM->pgm.s.pvZeroPgR3);
     957        AssertRelease(pVM->pgm.s.HCPhysZeroPg != NIL_RTHCPHYS);
    946958
    947959        /*
     
    9951007        return VINF_SUCCESS;
    9961008    }
    997     /* No cleanup necessary, MM frees all memory. */
     1009
     1010    /* Almost no cleanup necessary, MM frees all memory. */
     1011    PDMR3CritSectDelete(&pVM->pgm.s.CritSect);
    9981012
    9991013    return rc;
     
    16081622    pVM->pgm.s.paDynPageMapPaePTEsGC += offDelta;
    16091623    pVM->pgm.s.pbDynPageMapBaseGC += offDelta;
     1624
     1625    /*
     1626     * The Zero page.
     1627     */
     1628    pVM->pgm.s.pvZeroPgR0 = MMHyperR3ToR0(pVM, pVM->pgm.s.pvZeroPgR3);
     1629    AssertRelease(pVM->pgm.s.pvZeroPgR0);
    16101630
    16111631    /*
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