Changeset 24960 in vbox
- Timestamp:
- Nov 25, 2009 3:58:56 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 55258
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r24874 r24960 3374 3374 bool pgmPoolIsDirtyPage(PVM pVM, RTGCPHYS GCPhys); 3375 3375 int pgmPoolTrackUpdateGCPhys(PVM pVM, PPGMPAGE pPhysPage, bool fFlushPTEs, bool *pfFlushTLBs); 3376 void pgmPoolInvalidateDirtyPage(PVM pVM, RTGCPHYS GCPhysPT); 3376 3377 DECLINLINE(int) pgmPoolTrackFlushGCPhys(PVM pVM, PPGMPAGE pPhysPage, bool *pfFlushTLBs) 3377 3378 { -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r24764 r24960 1788 1788 return; 1789 1789 } 1790 1791 /** 1792 * Reset all dirty pages by reinstating page monitoring. 1793 * 1794 * @param pVM VM Handle. 1795 * @param GCPhysPT Physical address of the page table 1796 */ 1797 void pgmPoolInvalidateDirtyPage(PVM pVM, RTGCPHYS GCPhysPT) 1798 { 1799 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 1800 Assert(PGMIsLocked(pVM)); 1801 Assert(pPool->cDirtyPages <= RT_ELEMENTS(pPool->aIdxDirtyPages)); 1802 unsigned idxDirtyPage = RT_ELEMENTS(pPool->aIdxDirtyPages); 1803 1804 if (!pPool->cDirtyPages) 1805 return; 1806 1807 GCPhysPT = GCPhysPT & ~(RTGCPHYS)(PAGE_SIZE - 1); 1808 1809 for (unsigned i = 0; i < RT_ELEMENTS(pPool->aIdxDirtyPages); i++) 1810 { 1811 if (pPool->aIdxDirtyPages[i] != NIL_PGMPOOL_IDX) 1812 { 1813 unsigned idxPage = pPool->aIdxDirtyPages[i]; 1814 1815 PPGMPOOLPAGE pPage = &pPool->aPages[idxPage]; 1816 if (pPage->GCPhys == GCPhysPT) 1817 { 1818 idxDirtyPage = i; 1819 break; 1820 } 1821 } 1822 } 1823 1824 if (idxDirtyPage != RT_ELEMENTS(pPool->aIdxDirtyPages)) 1825 { 1826 pgmPoolFlushDirtyPage(pVM, pPool, idxDirtyPage, true /* allow removal of reused page tables*/); 1827 if ( pPool->cDirtyPages != RT_ELEMENTS(pPool->aIdxDirtyPages) 1828 && pPool->aIdxDirtyPages[pPool->idxFreeDirtyPage] != NIL_PGMPOOL_IDX) 1829 { 1830 unsigned i; 1831 for (i = 0; i < RT_ELEMENTS(pPool->aIdxDirtyPages); i++) 1832 { 1833 if (pPool->aIdxDirtyPages[i] == NIL_PGMPOOL_IDX) 1834 { 1835 pPool->idxFreeDirtyPage = i; 1836 break; 1837 } 1838 } 1839 AssertMsg(i != RT_ELEMENTS(pPool->aIdxDirtyPages), ("cDirtyPages %d", pPool->cDirtyPages)); 1840 } 1841 } 1842 } 1843 1790 1844 # endif /* PGMPOOL_WITH_OPTIMIZED_DIRTY_PT */ 1791 1845 #endif /* PGMPOOL_WITH_MONITORING */
Note:
See TracChangeset
for help on using the changeset viewer.