Changeset 29301 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 10, 2010 12:45:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r29297 r29301 1593 1593 /* Force a PGM pool flush as guest ram references have been changed. */ 1594 1594 /** todo; not entirely SMP safe; assuming for now the guest takes care of this internally (not touch mapped mmio while changing the mapping). */ 1595 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 1596 { 1597 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 1598 1599 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 1600 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 1601 } 1595 PVMCPU pVCpu = VMMGetCpu(pVM); 1596 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 1597 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 1602 1598 } 1603 1599 else … … 1772 1768 /* Force a PGM pool flush as guest ram references have been changed. */ 1773 1769 /** todo; not entirely SMP safe; assuming for now the guest takes care of this internally (not touch mapped mmio while changing the mapping). */ 1774 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 1775 { 1776 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 1777 1778 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 1779 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 1780 } 1770 PVMCPU pVCpu = VMMGetCpu(pVM); 1771 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 1772 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 1781 1773 1782 1774 PGMPhysInvalidatePageMapTLB(pVM); … … 2153 2145 PGM_PAGE_SET_TYPE(pPageDst, PGMPAGETYPE_MMIO2); 2154 2146 PGM_PAGE_SET_STATE(pPageDst, PGM_PAGE_STATE_ALLOCATED); 2147 PGM_PAGE_SET_PDE_TYPE(pPageDst, PGM_PAGE_PDE_TYPE_DONTCARE); 2148 PGM_PAGE_SET_PTE_INDEX(pPageDst, 0); 2155 2149 2156 2150 pVM->pgm.s.cZeroPages--; … … 2172 2166 /* Force a PGM pool flush as guest ram references have been changed. */ 2173 2167 /** todo; not entirely SMP safe; assuming for now the guest takes care of this internally (not touch mapped mmio while changing the mapping). */ 2174 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 2175 { 2176 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 2177 2178 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 2179 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 2180 } 2168 PVMCPU pVCpu = VMMGetCpu(pVM); 2169 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 2170 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 2181 2171 2182 2172 pgmUnlock(pVM); … … 2241 2231 pRam = pRam->pNextR3; 2242 2232 2243 RTHCPHYS const HCPhysZeroPg = pVM->pgm.s.HCPhysZeroPg;2244 Assert(HCPhysZeroPg != 0 && HCPhysZeroPg != NIL_RTHCPHYS);2245 2233 PPGMPAGE pPageDst = &pRam->aPages[(pCur->RamRange.GCPhys - pRam->GCPhys) >> PAGE_SHIFT]; 2246 2234 uint32_t cPagesLeft = pCur->RamRange.cb >> PAGE_SHIFT; 2247 2235 while (cPagesLeft-- > 0) 2248 2236 { 2249 PGM_PAGE_SET_HCPHYS(pPageDst, HCPhysZeroPg); 2250 PGM_PAGE_SET_TYPE(pPageDst, PGMPAGETYPE_RAM); 2251 PGM_PAGE_SET_STATE(pPageDst, PGM_PAGE_STATE_ZERO); 2252 PGM_PAGE_SET_PAGEID(pPageDst, NIL_GMM_PAGEID); 2253 PGM_PAGE_SET_PDE_TYPE(pPageDst, PGM_PAGE_PDE_TYPE_DONTCARE); 2254 2237 PGM_PAGE_INIT_ZERO(pPageDst, pVM, PGMPAGETYPE_RAM); 2255 2238 pVM->pgm.s.cZeroPages++; 2256 2239 pPageDst++; … … 2280 2263 /* Force a PGM pool flush as guest ram references have been changed. */ 2281 2264 /** todo; not entirely SMP safe; assuming for now the guest takes care of this internally (not touch mapped mmio while changing the mapping). */ 2282 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 2283 { 2284 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 2285 2286 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 2287 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 2288 } 2265 PVMCPU pVCpu = VMMGetCpu(pVM); 2266 pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_CLEAR_PGM_POOL; 2267 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 2289 2268 2290 2269 PGMPhysInvalidatePageMapTLB(pVM); … … 2614 2593 PGM_PAGE_SET_STATE(pPage, PGM_PAGE_STATE_ALLOCATED); 2615 2594 PGM_PAGE_SET_PAGEID(pPage, pReq->aPages[iPage].idPage); 2595 PGM_PAGE_SET_PDE_TYPE(pPage, PGM_PAGE_PDE_TYPE_DONTCARE); 2596 PGM_PAGE_SET_PTE_INDEX(pPage, 0); 2616 2597 2617 2598 pRomPage->Virgin = *pPage; … … 3428 3409 PGM_PAGE_SET_STATE(pPage, PGM_PAGE_STATE_ALLOCATED); 3429 3410 PGM_PAGE_SET_PDE_TYPE(pPage, PGM_PAGE_PDE_TYPE_PDE); 3411 PGM_PAGE_SET_PTE_INDEX(pPage, 0); 3430 3412 3431 3413 /* Somewhat dirty assumption that page ids are increasing. */ … … 3646 3628 PGM_PAGE_SET_PAGEID(pPage, NIL_GMM_PAGEID); 3647 3629 PGM_PAGE_SET_PDE_TYPE(pPage, PGM_PAGE_PDE_TYPE_DONTCARE); 3630 PGM_PAGE_SET_PTE_INDEX(pPage, 0); 3648 3631 3649 3632 /* Flush physical page map TLB entry. */
Note:
See TracChangeset
for help on using the changeset viewer.