VirtualBox

Changeset 60401 in vbox for trunk


Ignore:
Timestamp:
Apr 9, 2016 11:10:40 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106487
Message:

PGM: Converted NO_RAM_RESET into a CFGM option (PGM/ZeroRamPagesOnReset).

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

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

    r58781 r60401  
    13631363
    13641364    rc = CFGMR3QueryBoolDef(CFGMR3GetRoot(pVM), "PageFusionAllowed", &pVM->pgm.s.fPageFusionAllowed, false);
     1365    AssertLogRelRCReturn(rc, rc);
     1366
     1367    /** @cfgm{/PGM/ZeroRamPagesOnReset, boolean, true}
     1368     * Whether to clear RAM pages on (hard) reset. */
     1369    rc = CFGMR3QueryBoolDef(pCfgPGM, "ZeroRamPagesOnReset", &pVM->pgm.s.fZeroRamPagesOnReset, true);
    13651370    AssertLogRelRCReturn(rc, rc);
    13661371
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r58782 r60401  
    19481948        AssertMsg(((RTGCPHYS)iPage << PAGE_SHIFT) == pRam->cb, ("%RGp %RGp\n", (RTGCPHYS)iPage << PAGE_SHIFT, pRam->cb));
    19491949
    1950 #ifndef NO_RAM_RESET
    1951         if (!pVM->pgm.s.fRamPreAlloc)
    1952 #else
    1953         if (0)
    1954 #endif
     1950        if (   !pVM->pgm.s.fRamPreAlloc
     1951            && pVM->pgm.s.fZeroRamPagesOnReset)
    19551952        {
    19561953            /* Replace all RAM pages by ZERO pages. */
     
    20252022
    20262023                            case PGM_PAGE_STATE_ALLOCATED:
    2027                             {
    2028                                 void *pvPage;
    2029                                 rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT), &pvPage);
    2030                                 AssertLogRelRCReturn(rc, rc);
    2031 #ifndef NO_RAM_RESET
    2032                                 ASMMemZeroPage(pvPage);
    2033 #endif
     2024                                if (pVM->pgm.s.fZeroRamPagesOnReset)
     2025                                {
     2026                                    void *pvPage;
     2027                                    rc = pgmPhysPageMap(pVM, pPage, pRam->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT), &pvPage);
     2028                                    AssertLogRelRCReturn(rc, rc);
     2029                                    ASMMemZeroPage(pvPage);
     2030                                }
    20342031                                break;
    2035                             }
    20362032                        }
    20372033                        break;
     
    35773573         */
    35783574#ifndef VBOX_STRICT
    3579         if (pVM->pgm.s.fRestoreRomPagesAtReset)
     3575        if (pVM->pgm.s.fRestoreRomPagesOnReset)
    35803576#endif
    35813577        {
     
    35933589                if (memcmp(pvDstPage, pbSrcPage, RT_MIN(cbSrcLeft, PAGE_SIZE)))
    35943590                {
    3595                     if (pVM->pgm.s.fRestoreRomPagesAtReset)
     3591                    if (pVM->pgm.s.fRestoreRomPagesOnReset)
    35963592                    {
    35973593                        void *pvDstPageW;
     
    36133609    /* Clear the ROM restore flag now as we only need to do this once after
    36143610       loading saved state. */
    3615     pVM->pgm.s.fRestoreRomPagesAtReset = false;
     3611    pVM->pgm.s.fRestoreRomPagesOnReset = false;
    36163612
    36173613    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp

    r58781 r60401  
    33013301static DECLCALLBACK(int) pgmR3LoadDone(PVM pVM, PSSMHANDLE pSSM)
    33023302{
    3303     pVM->pgm.s.fRestoreRomPagesAtReset = true;
     3303    pVM->pgm.s.fRestoreRomPagesOnReset = true;
    33043304    NOREF(pSSM);
    33053305    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r60228 r60401  
    32493249     * enables the VM to start using an updated ROM without requiring powering
    32503250     * down the VM, just rebooting or resetting it. */
    3251     bool                            fRestoreRomPagesAtReset;
     3251    bool                            fRestoreRomPagesOnReset;
     3252    /** Whether to automatically clear all RAM pages on reset. */
     3253    bool                            fZeroRamPagesOnReset;
     3254    /** Alignment padding. */
     3255    bool                            afAlignment3[7];
    32523256
    32533257    /** Indicates that PGMR3FinalizeMappings has been called and that further
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