VirtualBox

Changeset 22506 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 27, 2009 11:28:43 AM (15 years ago)
Author:
vboxsync
Message:

Flush any monitored duplicates as we will disable write protection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp

    r22504 r22506  
    12861286        &&  !fForcedFlush
    12871287        &&  pPage->enmKind == PGMPOOLKIND_PAE_PT_FOR_PAE_PT
    1288         &&  pPage->cModifications >= cMaxModifications
    1289         &&  pPage->iMonitoredNext != NIL_PGMPOOL_IDX
    1290         &&  pPage->iMonitoredPrev != NIL_PGMPOOL_IDX)
     1288        &&  pPage->cModifications >= cMaxModifications)
    12911289    {
    12921290        Assert(!pgmPoolIsPageLocked(&pVM->pgm.s, pPage));
    12931291        Assert(pPage->fDirty == false);
    12941292
     1293        /* Flush any monitored duplicates as we will disable write protection. */
     1294        if (    pPage->iMonitoredNext != NIL_PGMPOOL_IDX
     1295            ||  pPage->iMonitoredPrev != NIL_PGMPOOL_IDX)
     1296        {
     1297            PPGMPOOLPAGE pPageHead = pPage;
     1298
     1299            /* Find the monitor head. */
     1300            while (pPageHead->iMonitoredPrev != NIL_PGMPOOL_IDX)
     1301                pPageHead = &pPool->aPages[pPageHead->iMonitoredPrev];
     1302
     1303            while (pPageHead)
     1304            {
     1305                unsigned idxNext = pPageHead->iMonitoredNext;
     1306
     1307                if (pPageHead != pPage)
     1308                {
     1309                    Log(("Flush duplicate page idx=%d GCPhys=%RGp type=%s\n", pPageHead->idx, pPageHead->GCPhys, pgmPoolPoolKindToStr(pPageHead->enmKind)));
     1310                    int rc2 = pgmPoolFlushPage(pPool, pPageHead);
     1311                    AssertRC(rc2);
     1312                }
     1313
     1314                if (idxNext == NIL_PGMPOOL_IDX)
     1315                    break;
     1316
     1317                pPageHead = &pPool->aPages[idxNext];
     1318            }
     1319        }
     1320
     1321        /* Temporarily allow write access to the page table again. */
    12951322        rc = PGMHandlerPhysicalPageTempOff(pVM, pPage->GCPhys, pPage->GCPhys);
    12961323        if (rc == VINF_SUCCESS)
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