Changeset 23088 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Sep 17, 2009 11:48:27 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r23067 r23088 1357 1357 && pPage->iMonitoredPrev == NIL_PGMPOOL_IDX) 1358 1358 { 1359 pgmPoolAddDirtyPage(pVM, pPool, pPage); 1360 1359 1361 /* Temporarily allow write access to the page table again. */ 1360 1362 rc = PGMHandlerPhysicalPageTempOff(pVM, pPage->GCPhys, pPage->GCPhys); … … 1368 1370 ("PGMShwModifyPage -> GCPtr=%RGv rc=%d\n", pvFault, rc)); 1369 1371 1370 pgmPoolAddDirtyPage(pVM, pPool, pPage);1371 1372 pPage->pvDirtyFault = pvFault; 1372 1373 … … 1504 1505 if (pShwPT->a[i].n.u1Present) 1505 1506 { 1506 /* Thethe old cached PTE is identical, then there's no need to flush the shadow copy. */1507 /* If the old cached PTE is identical, then there's no need to flush the shadow copy. */ 1507 1508 if ((pGstPT->a[i].u & X86_PTE_PAE_PG_MASK) == (pOldGstPT->a[i].u & X86_PTE_PAE_PG_MASK)) 1508 1509 { … … 1559 1560 Log(("Flush dirty page %RGp cMods=%d\n", pPage->GCPhys, pPage->cModifications)); 1560 1561 1561 /* Flush those PTEs that have changed. */ 1562 STAM_PROFILE_START(&pPool->StatTrackDeref,a); 1563 void *pvShw = PGMPOOL_PAGE_2_LOCKED_PTR(pPool->CTX_SUFF(pVM), pPage); 1564 void *pvGst; 1565 bool fFlush; 1566 int rc = PGM_GCPHYS_2_PTR(pPool->CTX_SUFF(pVM), pPage->GCPhys, &pvGst); AssertReleaseRC(rc); 1567 unsigned cChanges = pgmPoolTrackFlushPTPaePae(pPool, pPage, (PX86PTPAE)pvShw, (PCX86PTPAE)pvGst, (PCX86PTPAE)&pPool->aDirtyPages[idxSlot][0], fAllowRemoval, &fFlush); 1568 STAM_PROFILE_STOP(&pPool->StatTrackDeref,a); 1569 1570 /** Note: we might want to consider keeping the dirty page active in case there were many changes. */ 1571 if (fFlush) 1572 { 1573 Assert(fAllowRemoval); 1574 Log(("Flush reused page table!\n")); 1575 pgmPoolFlushPage(pPool, pPage); 1576 STAM_COUNTER_INC(&pPool->StatForceFlushReused); 1577 return; 1578 } 1579 1580 /* Write protect the page again to catch all write accesses. */ 1581 rc = PGMHandlerPhysicalReset(pVM, pPage->GCPhys); 1562 /* First write protect the page again to catch all write accesses. (before checking for changes -> SMP) */ 1563 int rc = PGMHandlerPhysicalReset(pVM, pPage->GCPhys); 1582 1564 Assert(rc == VINF_SUCCESS); 1583 1565 pPage->fDirty = false; … … 1594 1576 ("PGMShwGetPage -> GCPtr=%RGv rc=%d flags=%RX64\n", pPage->pvDirtyFault, rc, fFlags)); 1595 1577 #endif 1578 1579 /* Flush those PTEs that have changed. */ 1580 STAM_PROFILE_START(&pPool->StatTrackDeref,a); 1581 void *pvShw = PGMPOOL_PAGE_2_LOCKED_PTR(pPool->CTX_SUFF(pVM), pPage); 1582 void *pvGst; 1583 bool fFlush; 1584 rc = PGM_GCPHYS_2_PTR(pPool->CTX_SUFF(pVM), pPage->GCPhys, &pvGst); AssertReleaseRC(rc); 1585 unsigned cChanges = pgmPoolTrackFlushPTPaePae(pPool, pPage, (PX86PTPAE)pvShw, (PCX86PTPAE)pvGst, (PCX86PTPAE)&pPool->aDirtyPages[idxSlot][0], fAllowRemoval, &fFlush); 1586 STAM_PROFILE_STOP(&pPool->StatTrackDeref,a); 1587 1588 /** Note: we might want to consider keeping the dirty page active in case there were many changes. */ 1589 if (fFlush) 1590 { 1591 Assert(fAllowRemoval); 1592 Log(("Flush reused page table!\n")); 1593 pgmPoolFlushPage(pPool, pPage); 1594 STAM_COUNTER_INC(&pPool->StatForceFlushReused); 1595 return; 1596 } 1596 1597 1597 1598 /* This page is likely to be modified again, so reduce the nr of modifications just a bit here. */
Note:
See TracChangeset
for help on using the changeset viewer.