VirtualBox

Changeset 41462 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
May 28, 2012 11:42:50 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78205
Message:

PGM: Don't flush the shadow page pool on A20 change, just change the shadow CR3 (well, the current lazy code does a bit more, but whatever). A20 stats.

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

Legend:

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

    r41393 r41462  
    18201820
    18211821        PGM_REG_COUNTER(&pPgmCpu->cGuestModeChanges, "/PGM/CPU%u/cGuestModeChanges",  "Number of guest mode changes.");
     1822        PGM_REG_COUNTER(&pPgmCpu->cA20Changes, "/PGM/CPU%u/cA20Changes",  "Number of A20 gate changes.");
    18221823
    18231824#ifdef VBOX_WITH_STATISTICS
     
    25122513
    25132514        STAM_REL_COUNTER_RESET(&pVCpu->pgm.s.cGuestModeChanges);
     2515        STAM_REL_COUNTER_RESET(&pVCpu->pgm.s.cA20Changes);
    25142516    }
    25152517
     
    26172619    /* print info. */
    26182620    if (fGuest)
    2619         pHlp->pfnPrintf(pHlp, "Guest paging mode:  %s, changed %RU64 times, A20 %s\n",
     2621        pHlp->pfnPrintf(pHlp, "Guest paging mode:  %s (changed %RU64 times), A20 %s (changed %RU64 times)\n",
    26202622                        PGMGetModeName(pVM->aCpus[0].pgm.s.enmGuestMode), pVM->aCpus[0].pgm.s.cGuestModeChanges.c,
    2621                         pVM->aCpus[0].pgm.s.fA20Enabled ? "enabled" : "disabled");
     2623                        pVM->aCpus[0].pgm.s.fA20Enabled ? "enabled" : "disabled", pVM->aCpus[0].pgm.s.cA20Changes.c);
    26222624    if (fShadow)
    26232625        pHlp->pfnPrintf(pHlp, "Shadow paging mode: %s\n", PGMGetModeName(pVM->aCpus[0].pgm.s.enmShadowMode));
     
    36273629    return rc;
    36283630}
     3631
     3632
     3633/**
     3634 * Called by PGMR3PhysSetA20 after changing the A20 state.
     3635 *
     3636 * @param   pVCpu   The VMCPU to operate on.
     3637 */
     3638void pgmR3RefreshShadowModeAfterA20Change(PVMCPU pVCpu)
     3639{
     3640    /** @todo Probably doing a bit too much here. */
     3641    int rc = pgmR3ExitShadowModeBeforePoolFlush(pVCpu);
     3642    AssertReleaseRC(rc);
     3643    rc = pgmR3ReEnterShadowModeAfterPoolFlush(pVCpu->CTX_SUFF(pVM), pVCpu);
     3644    AssertReleaseRC(rc);
     3645}
     3646
    36293647
    36303648#ifdef VBOX_WITH_DEBUGGER
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r41435 r41462  
    23302330
    23312331    /* Force a PGM pool flush as guest ram references have been changed. */
    2332     /** todo; not entirely SMP safe; assuming for now the guest takes care of this internally (not touch mapped mmio while changing the mapping). */
     2332    /** @todo Not entirely SMP safe; assuming for now the guest takes care of
     2333     *       this internally (not touch mapped mmio while changing the mapping). */
    23332334    PVMCPU pVCpu = VMMGetCpu(pVM);
    23342335    pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
     
    27332734
    27342735        /* Force a PGM pool flush as guest ram references have been changed. */
    2735         /** todo; not entirely SMP safe; assuming for now the guest takes care of this internally (not touch mapped mmio while changing the mapping). */
     2736        /** @todo not entirely SMP safe; assuming for now the guest takes care of
     2737         *  this internally (not touch mapped mmio while changing the mapping). */
    27362738        PVMCPU pVCpu = VMMGetCpu(pVM);
    27372739        pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL;
     
    37183720        /** @todo we're not handling this correctly for VT-x / AMD-V. See #2911 */
    37193721#ifdef PGM_WITH_A20
    3720         pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL | PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL;
     3722        pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL;
    37213723        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
     3724        pgmR3RefreshShadowModeAfterA20Change(pVCpu);
    37223725#endif
     3726        STAM_REL_COUNTER_INC(&pVCpu->pgm.s.cA20Changes);
    37233727    }
    37243728}
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