Changeset 41456 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 28, 2012 10:11:53 AM (13 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r41420 r41456 1616 1616 1617 1617 /* Note that iPTDst can be used to index the guest PT even in the pae/32bit combo as we copy only half the table; see pgmPoolAddDirtyPage. */ 1618 pGstPT = (PGSTPT)&pPool->aDirtyPages[pShwPage->idxDirty ].aPage[0];1618 pGstPT = (PGSTPT)&pPool->aDirtyPages[pShwPage->idxDirtyEntry].aPage[0]; 1619 1619 GCPhysOldPage = GST_GET_PTE_GCPHYS(pGstPT->a[iPTDst]); 1620 1620 pGstPT->a[iPTDst].u = PteSrc.u; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r41386 r41456 160 160 } 161 161 162 162 163 /** 163 164 * Process shadow entries before they are changed by the guest. … … 174 175 * @param cbWrite Write size; might be zero if the caller knows we're not crossing entry boundaries 175 176 */ 176 void pgmPoolMonitorChainChanging(PVMCPU pVCpu, PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTGCPHYS GCPhysFault, CTXTYPE(RTGCPTR, RTHCPTR, RTGCPTR) pvAddress, unsigned cbWrite) 177 void pgmPoolMonitorChainChanging(PVMCPU pVCpu, PPGMPOOL pPool, PPGMPOOLPAGE pPage, RTGCPHYS GCPhysFault, 178 CTXTYPE(RTGCPTR, RTHCPTR, RTGCPTR) pvAddress, unsigned cbWrite) 177 179 { 178 180 AssertMsg(pPage->iMonitoredPrev == NIL_PGMPOOL_IDX, ("%u (idx=%u)\n", pPage->iMonitoredPrev, pPage->idx)); … … 690 692 691 693 # ifndef IN_RING3 694 692 695 /** 693 696 * Checks if a access could be a fork operation in progress. … … 812 815 } 813 816 817 814 818 /** 815 819 * Flushes the page being accessed. … … 866 870 return rc; 867 871 } 872 868 873 869 874 /** … … 1024 1029 } 1025 1030 1031 1026 1032 /** 1027 1033 * \#PF Handler callback for PT write accesses. … … 1036 1042 * @param pvUser User argument. 1037 1043 */ 1038 DECLEXPORT(int) pgmPoolAccessHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser) 1044 DECLEXPORT(int) pgmPoolAccessHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, 1045 RTGCPHYS GCPhysFault, void *pvUser) 1039 1046 { 1040 1047 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), a); … … 1114 1121 */ 1115 1122 pVCpu->pgm.s.cPoolAccessHandler++; 1116 if ( pPage-> pvLastAccessHandlerRip >= pRegFrame->rip - 0x40 /* observed loops in Windows 7 x64 */1117 && pPage-> pvLastAccessHandlerRip < pRegFrame->rip + 0x401118 && pvFault == (pPage-> pvLastAccessHandlerFault + pDis->param1.size)1119 && pVCpu->pgm.s.cPoolAccessHandler == (pPage->cLastAccessHandlerCount + 1))1123 if ( pPage->GCPtrLastAccessHandlerRip >= pRegFrame->rip - 0x40 /* observed loops in Windows 7 x64 */ 1124 && pPage->GCPtrLastAccessHandlerRip < pRegFrame->rip + 0x40 1125 && pvFault == (pPage->GCPtrLastAccessHandlerFault + pDis->param1.size) 1126 && pVCpu->pgm.s.cPoolAccessHandler == pPage->cLastAccessHandler + 1) 1120 1127 { 1121 1128 Log(("Possible page reuse cMods=%d -> %d (locked=%d type=%s)\n", pPage->cModifications, pPage->cModifications * 2, pgmPoolIsPageLocked(pPage), pgmPoolPoolKindToStr(pPage->enmKind))); 1122 1129 Assert(pPage->cModifications < 32000); 1123 pPage->cModifications = pPage->cModifications * 2;1124 pPage-> pvLastAccessHandlerFault= pvFault;1125 pPage->cLastAccessHandler Count= pVCpu->pgm.s.cPoolAccessHandler;1130 pPage->cModifications = pPage->cModifications * 2; 1131 pPage->GCPtrLastAccessHandlerFault = pvFault; 1132 pPage->cLastAccessHandler = pVCpu->pgm.s.cPoolAccessHandler; 1126 1133 if (pPage->cModifications >= cMaxModifications) 1127 1134 { … … 1162 1169 && (pvFault & PAGE_OFFSET_MASK) == 0) 1163 1170 { 1164 pPage-> pvLastAccessHandlerFault = pvFault;1165 pPage->cLastAccessHandler Count= pVCpu->pgm.s.cPoolAccessHandler;1166 pPage-> pvLastAccessHandlerRip = pRegFrame->rip;1171 pPage->GCPtrLastAccessHandlerFault = pvFault; 1172 pPage->cLastAccessHandler = pVCpu->pgm.s.cPoolAccessHandler; 1173 pPage->GCPtrLastAccessHandlerRip = pRegFrame->rip; 1167 1174 /* Make sure we don't kick out a page too quickly. */ 1168 1175 if (pPage->cModifications > 8) 1169 1176 pPage->cModifications = 2; 1170 1177 } 1178 else if (pPage->GCPtrLastAccessHandlerFault == pvFault) 1179 { 1180 /* ignore the 2nd write to this page table entry. */ 1181 pPage->cLastAccessHandler = pVCpu->pgm.s.cPoolAccessHandler; 1182 } 1171 1183 else 1172 if (pPage->pvLastAccessHandlerFault == pvFault) 1173 { 1174 /* ignore the 2nd write to this page table entry. */ 1175 pPage->cLastAccessHandlerCount = pVCpu->pgm.s.cPoolAccessHandler; 1176 } 1177 else 1178 { 1179 pPage->pvLastAccessHandlerFault = 0; 1180 pPage->pvLastAccessHandlerRip = 0; 1184 { 1185 pPage->GCPtrLastAccessHandlerFault = NIL_RTGCPTR; 1186 pPage->GCPtrLastAccessHandlerRip = 0; 1181 1187 } 1182 1188 … … 1297 1303 || rc == VERR_PAGE_NOT_PRESENT, 1298 1304 ("PGMShwModifyPage -> GCPtr=%RGv rc=%d\n", pvFault, rc)); 1299 1300 pPage->pvDirtyFault = pvFault; 1305 # ifdef VBOX_STRICT 1306 pPage->GCPtrDirtyFault = pvFault; 1307 # endif 1301 1308 1302 1309 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pPool)->CTX_SUFF_Z(StatMonitor), a); … … 1401 1408 AssertMsg(!cErrors, ("cErrors=%d: last rc=%d idx=%d guest %RX64 shw=%RX64 vs %RHp\n", cErrors, LastRc, LastPTE, pGstPT->a[LastPTE].u, PGMSHWPTEPAE_GET_LOG(pShwPT->a[LastPTE]), LastHCPhys)); 1402 1409 } 1410 1403 1411 1404 1412 /** … … 1536 1544 } 1537 1545 1546 1538 1547 /** 1539 1548 * Clear references to guest physical memory in a PAE / PAE page table. … … 1603 1612 } 1604 1613 1614 1605 1615 /** 1606 1616 * Flush a dirty page … … 1642 1652 uint64_t fFlags = 0; 1643 1653 RTHCPHYS HCPhys; 1644 rc = PGMShwGetPage(VMMGetCpu(pVM), pPage-> pvDirtyFault, &fFlags, &HCPhys);1654 rc = PGMShwGetPage(VMMGetCpu(pVM), pPage->GCPtrDirtyFault, &fFlags, &HCPhys); 1645 1655 AssertMsg( ( rc == VINF_SUCCESS 1646 1656 && (!(fFlags & X86_PTE_RW) || HCPhys != pPage->Core.Key)) … … 1648 1658 || rc == VERR_PAGE_TABLE_NOT_PRESENT 1649 1659 || rc == VERR_PAGE_NOT_PRESENT, 1650 ("PGMShwGetPage -> GCPtr=%RGv rc=%d flags=%RX64\n", pPage-> pvDirtyFault, rc, fFlags));1660 ("PGMShwGetPage -> GCPtr=%RGv rc=%d flags=%RX64\n", pPage->GCPtrDirtyFault, rc, fFlags)); 1651 1661 #endif 1652 1662 … … 1699 1709 #endif 1700 1710 } 1711 1701 1712 1702 1713 # ifndef IN_RING3 … … 1750 1761 STAM_COUNTER_INC(&pPool->StatDirtyPage); 1751 1762 pPage->fDirty = true; 1752 pPage->idxDirty = idxFree;1763 pPage->idxDirtyEntry = (uint8_t)idxFree; Assert(pPage->idxDirtyEntry == idxFree); 1753 1764 pPool->aDirtyPages[idxFree].uIdx = pPage->idx; 1754 1765 pPool->cDirtyPages++; … … 1775 1786 } 1776 1787 # endif /* !IN_RING3 */ 1788 1777 1789 1778 1790 /** … … 1807 1819 } 1808 1820 1821 1809 1822 /** 1810 1823 * Reset all dirty pages by reinstating page monitoring. … … 1845 1858 } 1846 1859 1860 1847 1861 /** 1848 1862 * Invalidate the PT entry for the specified page … … 1865 1879 } 1866 1880 } 1881 1867 1882 1868 1883 /** … … 2443 2458 #ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT 2444 2459 if (pPageHead->fDirty) 2445 pgmPoolFlushDirtyPage(pPool->CTX_SUFF(pVM), pPool, pPageHead->idxDirty , false /* do not remove */);2460 pgmPoolFlushDirtyPage(pPool->CTX_SUFF(pVM), pPool, pPageHead->idxDirtyEntry, false /* do not remove */); 2446 2461 #endif 2447 2462 … … 2903 2918 # ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT 2904 2919 if (pPage->fDirty) 2905 pgmPoolFlushDirtyPage(pPool->CTX_SUFF(pVM), pPool, pPage->idxDirty , false /* do not remove */);2920 pgmPoolFlushDirtyPage(pPool->CTX_SUFF(pVM), pPool, pPage->idxDirtyEntry, false /* do not remove */); 2906 2921 # endif 2907 2922 … … 4403 4418 4404 4419 4405 4406 4420 /** 4407 4421 * Clear references to shadowed pages in a 32 bits page directory. … … 4428 4442 } 4429 4443 } 4444 4430 4445 4431 4446 /** … … 4464 4479 } 4465 4480 } 4481 4466 4482 4467 4483 /** … … 4726 4742 PGM_DYNMAP_UNUSED_HINT_VM(pVM, pvShw); 4727 4743 } 4744 4728 4745 4729 4746 /** … … 4794 4811 #ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT 4795 4812 if (pPage->fDirty) 4796 pgmPoolFlushDirtyPage(pVM, pPool, pPage->idxDirty , false /* do not remove */);4813 pgmPoolFlushDirtyPage(pVM, pPool, pPage->idxDirtyEntry, false /* do not remove */); 4797 4814 #endif 4798 4815 … … 4926 4943 } 4927 4944 4945 4928 4946 /** 4929 4947 * Allocates a page from the pool. … … 5009 5027 pPage->fMonitored = false; 5010 5028 pPage->fCached = false; 5011 #ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT5012 5029 pPage->fDirty = false; 5013 #endif5014 5030 pPage->fReusedFlushPending = false; 5015 5031 pPage->cModifications = 0; 5016 5032 pPage->iModifiedNext = NIL_PGMPOOL_IDX; 5017 5033 pPage->iModifiedPrev = NIL_PGMPOOL_IDX; 5018 pPage->cLocked = 0;5019 5034 pPage->cPresent = 0; 5020 5035 pPage->iFirstPresent = NIL_PGMPOOL_PRESENT_INDEX; 5021 pPage->pvLastAccessHandlerFault = 0; 5022 pPage->cLastAccessHandlerCount = 0; 5023 pPage->pvLastAccessHandlerRip = 0; 5036 pPage->idxDirtyEntry = 0; 5037 pPage->GCPtrLastAccessHandlerFault = NIL_RTGCPTR; 5038 pPage->GCPtrLastAccessHandlerRip = NIL_RTGCPTR; 5039 pPage->cLastAccessHandler = 0; 5040 pPage->cLocked = 0; 5041 # ifdef VBOX_STRICT 5042 pPage->GCPtrDirtyFault = NIL_RTGCPTR; 5043 # endif 5024 5044 5025 5045 /* … … 5083 5103 } 5084 5104 5105 5085 5106 /** 5086 5107 * Internal worker for finding a 'in-use' shadow page give by it's physical address. … … 5117 5138 } 5118 5139 5119 5120 5140 #ifdef IN_RING3 /* currently only used in ring 3; save some space in the R0 & GC modules (left it here as we might need it elsewhere later on) */ 5141 5121 5142 /** 5122 5143 * Flush the specified page if present … … 5200 5221 return; 5201 5222 } 5223 5202 5224 #endif /* IN_RING3 */ 5203 5204 5225 #ifdef IN_RING3 5205 5206 5226 5207 5227 /** … … 5395 5415 STAM_PROFILE_STOP(&pPool->StatR3Reset, a); 5396 5416 } 5417 5397 5418 #endif /* IN_RING3 */ 5398 5419 5399 5420 #ifdef LOG_ENABLED 5421 /** 5422 * Stringifies a PGMPOOLKIND value. 5423 */ 5400 5424 static const char *pgmPoolPoolKindToStr(uint8_t enmKind) 5401 5425 { 5402 switch (enmKind)5403 { 5404 case PGMPOOLKIND_INVALID:5405 return "PGMPOOLKIND_INVALID";5406 case PGMPOOLKIND_FREE:5407 return "PGMPOOLKIND_FREE";5408 case PGMPOOLKIND_32BIT_PT_FOR_PHYS:5409 return "PGMPOOLKIND_32BIT_PT_FOR_PHYS";5410 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT:5411 return "PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT";5412 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB:5413 return "PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB";5414 case PGMPOOLKIND_PAE_PT_FOR_PHYS:5415 return "PGMPOOLKIND_PAE_PT_FOR_PHYS";5416 case PGMPOOLKIND_PAE_PT_FOR_32BIT_PT:5417 return "PGMPOOLKIND_PAE_PT_FOR_32BIT_PT";5418 case PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB:5419 return "PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB";5420 case PGMPOOLKIND_PAE_PT_FOR_PAE_PT:5421 return "PGMPOOLKIND_PAE_PT_FOR_PAE_PT";5422 case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB:5423 return "PGMPOOLKIND_PAE_PT_FOR_PAE_2MB";5424 case PGMPOOLKIND_32BIT_PD:5425 return "PGMPOOLKIND_32BIT_PD";5426 case PGMPOOLKIND_32BIT_PD_PHYS:5427 return "PGMPOOLKIND_32BIT_PD_PHYS";5428 case PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD:5429 return "PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD";5430 case PGMPOOLKIND_PAE_PD1_FOR_32BIT_PD:5431 return "PGMPOOLKIND_PAE_PD1_FOR_32BIT_PD";5432 case PGMPOOLKIND_PAE_PD2_FOR_32BIT_PD:5433 return "PGMPOOLKIND_PAE_PD2_FOR_32BIT_PD";5434 case PGMPOOLKIND_PAE_PD3_FOR_32BIT_PD:5435 return "PGMPOOLKIND_PAE_PD3_FOR_32BIT_PD";5436 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD:5437 return "PGMPOOLKIND_PAE_PD_FOR_PAE_PD";5438 case PGMPOOLKIND_PAE_PD_PHYS:5439 return "PGMPOOLKIND_PAE_PD_PHYS";5440 case PGMPOOLKIND_PAE_PDPT_FOR_32BIT:5441 return "PGMPOOLKIND_PAE_PDPT_FOR_32BIT";5442 case PGMPOOLKIND_PAE_PDPT:5443 return "PGMPOOLKIND_PAE_PDPT";5444 case PGMPOOLKIND_PAE_PDPT_PHYS:5445 return "PGMPOOLKIND_PAE_PDPT_PHYS";5446 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT:5447 return "PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT";5448 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS:5449 return "PGMPOOLKIND_64BIT_PDPT_FOR_PHYS";5450 case PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD:5451 return "PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD";5452 case PGMPOOLKIND_64BIT_PD_FOR_PHYS:5453 return "PGMPOOLKIND_64BIT_PD_FOR_PHYS";5454 case PGMPOOLKIND_64BIT_PML4:5455 return "PGMPOOLKIND_64BIT_PML4";5456 case PGMPOOLKIND_EPT_PDPT_FOR_PHYS:5457 return "PGMPOOLKIND_EPT_PDPT_FOR_PHYS";5458 case PGMPOOLKIND_EPT_PD_FOR_PHYS:5459 return "PGMPOOLKIND_EPT_PD_FOR_PHYS";5460 case PGMPOOLKIND_EPT_PT_FOR_PHYS:5461 return "PGMPOOLKIND_EPT_PT_FOR_PHYS";5462 case PGMPOOLKIND_ROOT_NESTED:5463 return "PGMPOOLKIND_ROOT_NESTED";5426 switch ((PGMPOOLKIND)enmKind) 5427 { 5428 case PGMPOOLKIND_INVALID: 5429 return "PGMPOOLKIND_INVALID"; 5430 case PGMPOOLKIND_FREE: 5431 return "PGMPOOLKIND_FREE"; 5432 case PGMPOOLKIND_32BIT_PT_FOR_PHYS: 5433 return "PGMPOOLKIND_32BIT_PT_FOR_PHYS"; 5434 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT: 5435 return "PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT"; 5436 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB: 5437 return "PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB"; 5438 case PGMPOOLKIND_PAE_PT_FOR_PHYS: 5439 return "PGMPOOLKIND_PAE_PT_FOR_PHYS"; 5440 case PGMPOOLKIND_PAE_PT_FOR_32BIT_PT: 5441 return "PGMPOOLKIND_PAE_PT_FOR_32BIT_PT"; 5442 case PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB: 5443 return "PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB"; 5444 case PGMPOOLKIND_PAE_PT_FOR_PAE_PT: 5445 return "PGMPOOLKIND_PAE_PT_FOR_PAE_PT"; 5446 case PGMPOOLKIND_PAE_PT_FOR_PAE_2MB: 5447 return "PGMPOOLKIND_PAE_PT_FOR_PAE_2MB"; 5448 case PGMPOOLKIND_32BIT_PD: 5449 return "PGMPOOLKIND_32BIT_PD"; 5450 case PGMPOOLKIND_32BIT_PD_PHYS: 5451 return "PGMPOOLKIND_32BIT_PD_PHYS"; 5452 case PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD: 5453 return "PGMPOOLKIND_PAE_PD0_FOR_32BIT_PD"; 5454 case PGMPOOLKIND_PAE_PD1_FOR_32BIT_PD: 5455 return "PGMPOOLKIND_PAE_PD1_FOR_32BIT_PD"; 5456 case PGMPOOLKIND_PAE_PD2_FOR_32BIT_PD: 5457 return "PGMPOOLKIND_PAE_PD2_FOR_32BIT_PD"; 5458 case PGMPOOLKIND_PAE_PD3_FOR_32BIT_PD: 5459 return "PGMPOOLKIND_PAE_PD3_FOR_32BIT_PD"; 5460 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: 5461 return "PGMPOOLKIND_PAE_PD_FOR_PAE_PD"; 5462 case PGMPOOLKIND_PAE_PD_PHYS: 5463 return "PGMPOOLKIND_PAE_PD_PHYS"; 5464 case PGMPOOLKIND_PAE_PDPT_FOR_32BIT: 5465 return "PGMPOOLKIND_PAE_PDPT_FOR_32BIT"; 5466 case PGMPOOLKIND_PAE_PDPT: 5467 return "PGMPOOLKIND_PAE_PDPT"; 5468 case PGMPOOLKIND_PAE_PDPT_PHYS: 5469 return "PGMPOOLKIND_PAE_PDPT_PHYS"; 5470 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 5471 return "PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT"; 5472 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 5473 return "PGMPOOLKIND_64BIT_PDPT_FOR_PHYS"; 5474 case PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD: 5475 return "PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD"; 5476 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 5477 return "PGMPOOLKIND_64BIT_PD_FOR_PHYS"; 5478 case PGMPOOLKIND_64BIT_PML4: 5479 return "PGMPOOLKIND_64BIT_PML4"; 5480 case PGMPOOLKIND_EPT_PDPT_FOR_PHYS: 5481 return "PGMPOOLKIND_EPT_PDPT_FOR_PHYS"; 5482 case PGMPOOLKIND_EPT_PD_FOR_PHYS: 5483 return "PGMPOOLKIND_EPT_PD_FOR_PHYS"; 5484 case PGMPOOLKIND_EPT_PT_FOR_PHYS: 5485 return "PGMPOOLKIND_EPT_PT_FOR_PHYS"; 5486 case PGMPOOLKIND_ROOT_NESTED: 5487 return "PGMPOOLKIND_ROOT_NESTED"; 5464 5488 } 5465 5489 return "Unknown kind!"; 5466 5490 } 5467 5491 #endif /* LOG_ENABLED*/ 5492 -
trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
r39755 r41456 909 909 } 910 910 911 911 912 /** 912 913 * Protect all pgm pool page table entries to monitor writes … … 914 915 * @param pVM The VM handle. 915 916 * 916 * Remark: assumes the caller will flush all TLBs (!!)917 * @remarks ASSUMES the caller will flush all TLBs!! 917 918 */ 918 919 void pgmR3PoolWriteProtectPages(PVM pVM) -
trunk/src/VBox/VMM/include/PGMInline.h
r39034 r41456 86 86 87 87 88 89 88 /** 90 89 * Gets the PGMPAGE structure for a guest page. … … 132 131 return VINF_SUCCESS; 133 132 } 134 135 136 133 137 134 … … 417 414 } 418 415 416 419 417 /** 420 418 * Maps the page into current context (RC and maybe R0). … … 503 501 504 502 #endif /* !IN_RC */ 505 506 503 507 504 /** … … 667 664 return VINF_SUCCESS; 668 665 } 666 669 667 670 668 /** … … 1174 1172 1175 1173 #endif /* !IN_RC */ 1176 1177 1174 1178 1175 /** … … 1431 1428 } 1432 1429 1430 1433 1431 /** 1434 1432 * Locks a page to prevent flushing (important for cr3 root pages or shadow pae pd pages). -
trunk/src/VBox/VMM/include/PGMInternal.h
r41437 r41456 2114 2114 R3R0PTRTYPE(void *) pvPageR3; 2115 2115 #endif 2116 /** The guest physical address. */2117 2116 #if HC_ARCH_BITS == 32 && GC_ARCH_BITS == 64 2118 2117 uint32_t Alignment0; 2119 2118 #endif 2119 /** The guest physical address. */ 2120 2120 RTGCPHYS GCPhys; 2121 2122 /** Access handler statistics to determine whether the guest is (re)initializing a page table. */2123 RTGCPTR pvLastAccessHandlerRip;2124 RTGCPTR pvLastAccessHandlerFault;2125 uint64_t cLastAccessHandlerCount;2126 2127 2121 /** The kind of page we're shadowing. (This is really a PGMPOOLKIND enum.) */ 2128 2122 uint8_t enmKind; 2129 2123 /** The subkind of page we're shadowing. (This is really a PGMPOOLACCESS enum.) */ 2130 2124 uint8_t enmAccess; 2125 /** This supplements enmKind and enmAccess */ 2126 bool fA20Enabled : 1; 2127 2128 /** Used to indicate that the page is zeroed. */ 2129 bool fZeroed : 1; 2130 /** Used to indicate that a PT has non-global entries. */ 2131 bool fSeenNonGlobal : 1; 2132 /** Used to indicate that we're monitoring writes to the guest page. */ 2133 bool fMonitored : 1; 2134 /** Used to indicate that the page is in the cache (e.g. in the GCPhys hash). 2135 * (All pages are in the age list.) */ 2136 bool fCached : 1; 2137 /** This is used by the R3 access handlers when invoked by an async thread. 2138 * It's a hack required because of REMR3NotifyHandlerPhysicalDeregister. */ 2139 bool volatile fReusedFlushPending : 1; 2140 /** Used to mark the page as dirty (write monitoring is temporarily 2141 * off). */ 2142 bool fDirty : 1; 2143 bool afPadding1 : 1+8; 2144 2131 2145 /** The index of this page. */ 2132 2146 uint16_t idx; … … 2154 2168 /** The previous page in the age list. */ 2155 2169 uint16_t iAgePrev; 2156 /** Used to indicate that the page is zeroed. */2157 bool fZeroed;2158 /** Used to indicate that a PT has non-global entries. */ 2159 bool fSeenNonGlobal;2160 /** Used to indicate that we're monitoring writes to the guest page. */2161 bool fMonitored;2162 /** Used to indicate that the page is in the cache (e.g. in the GCPhys hash).2163 * (All pages are in the age list.) */2164 bool fCached;2165 /** This is used by the R3 access handlers when invoked by an async thread.2166 * It's a hack required because of REMR3NotifyHandlerPhysicalDeregister. */2167 bool volatile fReusedFlushPending;2168 /** Used to mark the page as dirty (write monitoring is temporarily 2169 * off). */2170 bool fDirty; 2171 2172 /** Used to indicate that this page can't be flushed. Important for cr3 root pages or shadow pae pd pages). */2173 uint32_t cLocked; 2174 uint32_t idxDirty;2175 RTGCPTR pvDirtyFault; 2176 } PGMPOOLPAGE, *PPGMPOOLPAGE, **PPPGMPOOLPAGE;2170 /** Index into PGMPOOL::aDirtyPages if fDirty is set. */ 2171 uint8_t idxDirtyEntry; 2172 2173 /** @name Access handler statistics to determine whether the guest is 2174 * (re)initializing a page table. 2175 * @{ */ 2176 RTGCPTR GCPtrLastAccessHandlerRip; 2177 RTGCPTR GCPtrLastAccessHandlerFault; 2178 uint64_t cLastAccessHandler; 2179 /** @} */ 2180 /** Used to indicate that this page can't be flushed. Important for cr3 root pages or shadow pae pd pages. */ 2181 uint32_t volatile cLocked; 2182 #if GC_ARCH_BITS == 64 2183 uint32_t Alignment2; 2184 #endif 2185 # ifdef VBOX_STRICT 2186 RTGCPTR GCPtrDirtyFault; 2187 # endif 2188 } PGMPOOLPAGE; 2189 /** Pointer to a pool page. */ 2190 typedef PGMPOOLPAGE *PPGMPOOLPAGE; 2177 2191 /** Pointer to a const pool page. */ 2178 2192 typedef PGMPOOLPAGE const *PCPGMPOOLPAGE; 2193 /** Pointer to a pool page pointer. */ 2194 typedef PGMPOOLPAGE **PPPGMPOOLPAGE; 2179 2195 2180 2196 … … 2256 2272 uint32_t u32Padding2; 2257 2273 # endif 2258 /* Next available slot. */2274 /** Next available slot (in aDirtyPages). */ 2259 2275 uint32_t idxFreeDirtyPage; 2260 /* Number of active dirty pages. */2276 /** Number of active dirty pages. */ 2261 2277 uint32_t cDirtyPages; 2262 /* Array of current dirty pgm pool page indices. */2278 /** Array of current dirty pgm pool page indices. */ 2263 2279 struct 2264 2280 { -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r41268 r41456 838 838 GEN_CHECK_OFF(PGMPOOLPAGE, enmKind); 839 839 GEN_CHECK_OFF(PGMPOOLPAGE, enmAccess); 840 //GEN_CHECK_OFF(PGMPOOLPAGE, fA20Enabled); 841 //GEN_CHECK_OFF(PGMPOOLPAGE, fSeenNonGlobal); 842 //GEN_CHECK_OFF(PGMPOOLPAGE, fMonitored); 843 //GEN_CHECK_OFF(PGMPOOLPAGE, fCached); 844 //GEN_CHECK_OFF(PGMPOOLPAGE, fReusedFlushPending); 840 845 GEN_CHECK_OFF(PGMPOOLPAGE, idx); 841 846 GEN_CHECK_OFF(PGMPOOLPAGE, iNext); 842 #ifdef PGMPOOL_WITH_USER_TRACKING843 847 GEN_CHECK_OFF(PGMPOOLPAGE, iUserHead); 844 848 GEN_CHECK_OFF(PGMPOOLPAGE, cPresent); 845 849 GEN_CHECK_OFF(PGMPOOLPAGE, iFirstPresent); 846 #endif847 #ifdef PGMPOOL_WITH_MONITORING848 850 GEN_CHECK_OFF(PGMPOOLPAGE, cModifications); 849 851 GEN_CHECK_OFF(PGMPOOLPAGE, iModifiedNext); … … 851 853 GEN_CHECK_OFF(PGMPOOLPAGE, iMonitoredNext); 852 854 GEN_CHECK_OFF(PGMPOOLPAGE, iMonitoredPrev); 853 #endif854 #ifdef PGMPOOL_WITH_CACHE855 855 GEN_CHECK_OFF(PGMPOOLPAGE, iAgeNext); 856 856 GEN_CHECK_OFF(PGMPOOLPAGE, iAgePrev); 857 #endif 858 GEN_CHECK_OFF(PGMPOOLPAGE, fZeroed); 859 GEN_CHECK_OFF(PGMPOOLPAGE, fSeenNonGlobal); 860 GEN_CHECK_OFF(PGMPOOLPAGE, fMonitored); 861 GEN_CHECK_OFF(PGMPOOLPAGE, fCached); 862 GEN_CHECK_OFF(PGMPOOLPAGE, fReusedFlushPending); 857 GEN_CHECK_OFF(PGMPOOLPAGE, idxDirtyEntry); 858 GEN_CHECK_OFF(PGMPOOLPAGE, GCPtrLastAccessHandlerRip); 859 GEN_CHECK_OFF(PGMPOOLPAGE, GCPtrLastAccessHandlerFault); 860 GEN_CHECK_OFF(PGMPOOLPAGE, cLastAccessHandler); 863 861 GEN_CHECK_OFF(PGMPOOLPAGE, cLocked); 862 #ifdef VBOX_STRICT 863 GEN_CHECK_OFF(PGMPOOLPAGE, GCPtrDirtyFault); 864 #endif 864 865 GEN_CHECK_SIZE(PGMPOOL); 865 866 GEN_CHECK_OFF(PGMPOOL, pVMR3);
Note:
See TracChangeset
for help on using the changeset viewer.