VirtualBox

Changeset 30301 in vbox


Ignore:
Timestamp:
Jun 18, 2010 8:39:09 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62841
Message:

VMM: Flush REM TLB during the live save / teleportation shadow page pool flush.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMInternal.h

    r29646 r30301  
    34023402void            pgmR3PoolResetUnpluggedCpu(PVM pVM, PVMCPU pVCpu);
    34033403void            pgmR3PoolReset(PVM pVM);
    3404 void            pgmR3PoolClearAll(PVM pVM);
    3405 DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *pvUser);
     3404void            pgmR3PoolClearAll(PVM pVM, bool fFlushRemTlb);
     3405DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *fpvFlushRemTbl);
    34063406
    34073407#endif /* IN_RING3 */
  • trunk/src/VBox/VMM/PGMPool.cpp

    r30013 r30301  
    596596 * @param   pVM     The VM handle.
    597597 * @param   pVCpu   The VMCPU for the EMT we're being called on. Unused.
    598  * @param   pvUser  Unused parameter.
    599  *
    600  */
    601 DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *pvUser)
     598 * @param   fpvFlushRemTlb  When not NULL, we'll flush the REM TLB as well.
     599 *                          (This is the pvUser, so it has to be void *.)
     600 *
     601 */
     602DECLCALLBACK(VBOXSTRICTRC) pgmR3PoolClearAllRendezvous(PVM pVM, PVMCPU pVCpu, void *fpvFlushRemTbl)
    602603{
    603604    PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool);
     
    790791    /* Flush job finished. */
    791792    VM_FF_CLEAR(pVM, VM_FF_PGM_POOL_FLUSH_PENDING);
    792 
    793793    pPool->cPresent = 0;
    794794    pgmUnlock(pVM);
     795
    795796    PGM_INVL_ALL_VCPU_TLBS(pVM);
     797
     798    if (fpvFlushRemTbl)
     799        for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
     800            CPUMSetChangedFlags(&pVM->aCpus[idCpu], CPUM_CHANGED_GLOBAL_TLB_FLUSH);
     801
    796802    STAM_PROFILE_STOP(&pPool->StatClearAll, c);
    797803    return VINF_SUCCESS;
     
    802808 * Clears the shadow page pool.
    803809 *
    804  * @param   pVM         The VM handle.
    805  */
    806 void pgmR3PoolClearAll(PVM pVM)
     810 * @param   pVM             The VM handle.
     811 * @param   fFlushRemTlb    When set, the REM TLB is scheduled for flushing as
     812 *                          well.
     813 */
     814void pgmR3PoolClearAll(PVM pVM, bool fFlushRemTlb)
    807815{
    808     int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmR3PoolClearAllRendezvous, NULL);
     816    int rc = VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, pgmR3PoolClearAllRendezvous, &fFlushRemTlb);
    809817    AssertRC(rc);
    810818}
  • trunk/src/VBox/VMM/PGMSavedState.cpp

    r28800 r30301  
    15481548                        if (paLSPages[iPage].fIgnore)
    15491549                            continue;
    1550                         if (PGM_PAGE_GET_TYPE(&pCur->aPages[iPage]) != PGMPAGETYPE_RAM) /* in case of recent ramppings */
     1550                        if (PGM_PAGE_GET_TYPE(&pCur->aPages[iPage]) != PGMPAGETYPE_RAM) /* in case of recent remappings */
    15511551                            continue;
    15521552                        if (    PGM_PAGE_GET_STATE(&pCur->aPages[iPage])
     
    17751775    pgmR3ScanMmio2Pages(pVM, uPass);
    17761776    pgmR3ScanRamPages(pVM, false /*fFinalPass*/);
    1777     pgmR3PoolClearAll(pVM); /** @todo this could perhaps be optimized a bit. */
     1777    pgmR3PoolClearAll(pVM, true /*fFlushRemTlb*/); /** @todo this could perhaps be optimized a bit. */
    17781778
    17791779    /*
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r29702 r30301  
    25712571# ifdef IN_RING3 /* Don't flush in ring-0 or raw mode, it's taking too long. */
    25722572    if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)
    2573         pgmR3PoolClearAll(pVM);
     2573        pgmR3PoolClearAll(pVM, false /*fFlushRemTlb*/);
    25742574# else  /* !IN_RING3 */
    25752575    if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_CLEAR_PGM_POOL)
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