- Timestamp:
- Jul 26, 2010 5:46:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vm.h
r30684 r31123 207 207 struct PGMCPU s; 208 208 #endif 209 uint8_t padding[ 32*1024];/* multiple of 4096 */209 uint8_t padding[4096]; /* multiple of 4096 */ 210 210 } pgm; 211 211 -
trunk/src/VBox/VMM/PGM.cpp
r31102 r31123 606 606 *******************************************************************************/ 607 607 static int pgmR3InitPaging(PVM pVM); 608 static voidpgmR3InitStats(PVM pVM);608 static int pgmR3InitStats(PVM pVM); 609 609 static DECLCALLBACK(void) pgmR3PhysInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs); 610 610 static DECLCALLBACK(void) pgmR3InfoMode(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs); … … 1266 1266 } 1267 1267 1268 #ifdef VBOX_WITH_STATISTICS 1269 /* 1270 * Allocate memory for the statistics before someone tries to use them. 1271 */ 1272 size_t cbTotalStats = RT_ALIGN_Z(sizeof(PGMSTATS), 64) + RT_ALIGN_Z(sizeof(PGMCPUSTATS), 64) * pVM->cCpus; 1273 void *pv; 1274 rc = MMHyperAlloc(pVM, RT_ALIGN_Z(cbTotalStats, PAGE_SIZE), PAGE_SIZE, MM_TAG_PGM, &pv); 1275 AssertRCReturn(rc, rc); 1276 1277 pVM->pgm.s.pStatsR3 = (PGMSTATS *)pv; 1278 pVM->pgm.s.pStatsR0 = MMHyperCCToRC(pVM, pv); 1279 pVM->pgm.s.pStatsRC = MMHyperCCToRC(pVM, pv); 1280 pv = (uint8_t *)pv + RT_ALIGN_Z(sizeof(PGMSTATS), 64); 1281 1282 for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++) 1283 { 1284 pVM->aCpus[iCpu].pgm.s.pStatsR3 = (PGMCPUSTATS *)pv; 1285 pVM->aCpus[iCpu].pgm.s.pStatsR0 = MMHyperCCToRC(pVM, pv); 1286 pVM->aCpus[iCpu].pgm.s.pStatsRC = MMHyperCCToRC(pVM, pv); 1287 1288 pv = (uint8_t *)pv + RT_ALIGN_Z(sizeof(PGMCPUSTATS), 64); 1289 } 1290 #endif /* VBOX_WITH_STATISTICS */ 1291 1268 1292 /* 1269 1293 * Register callbacks, string formatters and the saved state data unit. … … 1563 1587 /** 1564 1588 * Init statistics 1565 */ 1566 static void pgmR3InitStats(PVM pVM) 1589 * @returns VBox status code. 1590 */ 1591 static int pgmR3InitStats(PVM pVM) 1567 1592 { 1568 1593 PPGM pPGM = &pVM->pgm.s; 1569 1594 int rc; 1570 1595 1596 /* 1597 * Release statistics. 1598 */ 1571 1599 /* Common - misc variables */ 1572 1600 STAM_REL_REG(pVM, &pPGM->cAllPages, STAMTYPE_U32, "/PGM/Page/cAllPages", STAMUNIT_COUNT, "The total number of pages."); … … 1627 1655 AssertRC(rc); 1628 1656 1629 PGM_REG_PROFILE(&pPGM->StatAllocLargePage, "/PGM/LargePage/Prof/Alloc", "Time spent by the host OS for large page allocation."); 1630 PGM_REG_PROFILE(&pPGM->StatClearLargePage, "/PGM/LargePage/Prof/Clear", "Time spent clearing the newly allocated large pages."); 1631 PGM_REG_PROFILE(&pPGM->StatR3IsValidLargePage, "/PGM/LargePage/Prof/R3/IsValid", "pgmPhysIsValidLargePage profiling - R3."); 1632 PGM_REG_PROFILE(&pPGM->StatRZIsValidLargePage, "/PGM/LargePage/Prof/RZ/IsValid", "pgmPhysIsValidLargePage profiling - RZ."); 1633 1634 PGM_REG_COUNTER(&pPGM->StatR3DetectedConflicts, "/PGM/R3/DetectedConflicts", "The number of times PGMR3CheckMappingConflicts() detected a conflict."); 1635 PGM_REG_PROFILE(&pPGM->StatR3ResolveConflict, "/PGM/R3/ResolveConflict", "pgmR3SyncPTResolveConflict() profiling (includes the entire relocation)."); 1636 PGM_REG_COUNTER(&pPGM->StatR3PhysRead, "/PGM/R3/Phys/Read", "The number of times PGMPhysRead was called."); 1637 PGM_REG_COUNTER_BYTES(&pPGM->StatR3PhysReadBytes, "/PGM/R3/Phys/Read/Bytes", "The number of bytes read by PGMPhysRead."); 1638 PGM_REG_COUNTER(&pPGM->StatR3PhysWrite, "/PGM/R3/Phys/Write", "The number of times PGMPhysWrite was called."); 1639 PGM_REG_COUNTER_BYTES(&pPGM->StatR3PhysWriteBytes, "/PGM/R3/Phys/Write/Bytes", "The number of bytes written by PGMPhysWrite."); 1640 PGM_REG_COUNTER(&pPGM->StatR3PhysSimpleRead, "/PGM/R3/Phys/Simple/Read", "The number of times PGMPhysSimpleReadGCPtr was called."); 1641 PGM_REG_COUNTER_BYTES(&pPGM->StatR3PhysSimpleReadBytes, "/PGM/R3/Phys/Simple/Read/Bytes", "The number of bytes read by PGMPhysSimpleReadGCPtr."); 1642 PGM_REG_COUNTER(&pPGM->StatR3PhysSimpleWrite, "/PGM/R3/Phys/Simple/Write", "The number of times PGMPhysSimpleWriteGCPtr was called."); 1643 PGM_REG_COUNTER_BYTES(&pPGM->StatR3PhysSimpleWriteBytes, "/PGM/R3/Phys/Simple/Write/Bytes", "The number of bytes written by PGMPhysSimpleWriteGCPtr."); 1644 1645 PGM_REG_COUNTER(&pPGM->StatRZChunkR3MapTlbHits, "/PGM/ChunkR3Map/TlbHitsRZ", "TLB hits."); 1646 PGM_REG_COUNTER(&pPGM->StatRZChunkR3MapTlbMisses, "/PGM/ChunkR3Map/TlbMissesRZ", "TLB misses."); 1647 PGM_REG_PROFILE(&pPGM->StatChunkAging, "/PGM/ChunkR3Map/Map/Aging", "Chunk aging profiling."); 1648 PGM_REG_PROFILE(&pPGM->StatChunkFindCandidate, "/PGM/ChunkR3Map/Map/Find", "Chunk unmap find profiling."); 1649 PGM_REG_PROFILE(&pPGM->StatChunkUnmap, "/PGM/ChunkR3Map/Map/Unmap", "Chunk unmap of address space profiling."); 1650 PGM_REG_PROFILE(&pPGM->StatChunkMap, "/PGM/ChunkR3Map/Map/Map", "Chunk map of address space profiling."); 1651 1652 PGM_REG_COUNTER(&pPGM->StatRZPageMapTlbHits, "/PGM/RZ/Page/MapTlbHits", "TLB hits."); 1653 PGM_REG_COUNTER(&pPGM->StatRZPageMapTlbMisses, "/PGM/RZ/Page/MapTlbMisses", "TLB misses."); 1654 PGM_REG_COUNTER(&pPGM->StatR3ChunkR3MapTlbHits, "/PGM/ChunkR3Map/TlbHitsR3", "TLB hits."); 1655 PGM_REG_COUNTER(&pPGM->StatR3ChunkR3MapTlbMisses, "/PGM/ChunkR3Map/TlbMissesR3", "TLB misses."); 1656 PGM_REG_COUNTER(&pPGM->StatR3PageMapTlbHits, "/PGM/R3/Page/MapTlbHits", "TLB hits."); 1657 PGM_REG_COUNTER(&pPGM->StatR3PageMapTlbMisses, "/PGM/R3/Page/MapTlbMisses", "TLB misses."); 1658 PGM_REG_COUNTER(&pPGM->StatPageMapTlbFlushes, "/PGM/R3/Page/MapTlbFlushes", "TLB flushes (all contexts)."); 1659 PGM_REG_COUNTER(&pPGM->StatPageMapTlbFlushEntry, "/PGM/R3/Page/MapTlbFlushEntry", "TLB entry flushes (all contexts)."); 1660 1661 PGM_REG_PROFILE(&pPGM->StatRZSyncCR3HandlerVirtualUpdate, "/PGM/RZ/SyncCR3/Handlers/VirtualUpdate", "Profiling of the virtual handler updates."); 1662 PGM_REG_PROFILE(&pPGM->StatRZSyncCR3HandlerVirtualReset, "/PGM/RZ/SyncCR3/Handlers/VirtualReset", "Profiling of the virtual handler resets."); 1663 PGM_REG_PROFILE(&pPGM->StatR3SyncCR3HandlerVirtualUpdate, "/PGM/R3/SyncCR3/Handlers/VirtualUpdate", "Profiling of the virtual handler updates."); 1664 PGM_REG_PROFILE(&pPGM->StatR3SyncCR3HandlerVirtualReset, "/PGM/R3/SyncCR3/Handlers/VirtualReset", "Profiling of the virtual handler resets."); 1665 1666 PGM_REG_COUNTER(&pPGM->StatRZPhysHandlerReset, "/PGM/RZ/PhysHandlerReset", "The number of times PGMHandlerPhysicalReset is called."); 1667 PGM_REG_COUNTER(&pPGM->StatR3PhysHandlerReset, "/PGM/R3/PhysHandlerReset", "The number of times PGMHandlerPhysicalReset is called."); 1668 PGM_REG_PROFILE(&pPGM->StatRZVirtHandlerSearchByPhys, "/PGM/RZ/VirtHandlerSearchByPhys", "Profiling of pgmHandlerVirtualFindByPhysAddr."); 1669 PGM_REG_PROFILE(&pPGM->StatR3VirtHandlerSearchByPhys, "/PGM/R3/VirtHandlerSearchByPhys", "Profiling of pgmHandlerVirtualFindByPhysAddr."); 1670 1671 PGM_REG_COUNTER(&pPGM->StatRZPageReplaceShared, "/PGM/RZ/Page/ReplacedShared", "Times a shared page was replaced."); 1672 PGM_REG_COUNTER(&pPGM->StatRZPageReplaceZero, "/PGM/RZ/Page/ReplacedZero", "Times the zero page was replaced."); 1673 /// @todo PGM_REG_COUNTER(&pPGM->StatRZPageHandyAllocs, "/PGM/RZ/Page/HandyAllocs", "Number of times we've allocated more handy pages."); 1674 PGM_REG_COUNTER(&pPGM->StatR3PageReplaceShared, "/PGM/R3/Page/ReplacedShared", "Times a shared page was replaced."); 1675 PGM_REG_COUNTER(&pPGM->StatR3PageReplaceZero, "/PGM/R3/Page/ReplacedZero", "Times the zero page was replaced."); 1676 /// @todo PGM_REG_COUNTER(&pPGM->StatR3PageHandyAllocs, "/PGM/R3/Page/HandyAllocs", "Number of times we've allocated more handy pages."); 1677 1678 PGM_REG_COUNTER(&pPGM->StatRZPhysRead, "/PGM/RZ/Phys/Read", "The number of times PGMPhysRead was called."); 1679 PGM_REG_COUNTER_BYTES(&pPGM->StatRZPhysReadBytes, "/PGM/RZ/Phys/Read/Bytes", "The number of bytes read by PGMPhysRead."); 1680 PGM_REG_COUNTER(&pPGM->StatRZPhysWrite, "/PGM/RZ/Phys/Write", "The number of times PGMPhysWrite was called."); 1681 PGM_REG_COUNTER_BYTES(&pPGM->StatRZPhysWriteBytes, "/PGM/RZ/Phys/Write/Bytes", "The number of bytes written by PGMPhysWrite."); 1682 PGM_REG_COUNTER(&pPGM->StatRZPhysSimpleRead, "/PGM/RZ/Phys/Simple/Read", "The number of times PGMPhysSimpleReadGCPtr was called."); 1683 PGM_REG_COUNTER_BYTES(&pPGM->StatRZPhysSimpleReadBytes, "/PGM/RZ/Phys/Simple/Read/Bytes", "The number of bytes read by PGMPhysSimpleReadGCPtr."); 1684 PGM_REG_COUNTER(&pPGM->StatRZPhysSimpleWrite, "/PGM/RZ/Phys/Simple/Write", "The number of times PGMPhysSimpleWriteGCPtr was called."); 1685 PGM_REG_COUNTER_BYTES(&pPGM->StatRZPhysSimpleWriteBytes, "/PGM/RZ/Phys/Simple/Write/Bytes", "The number of bytes written by PGMPhysSimpleWriteGCPtr."); 1657 PGMSTATS *pStats = pVM->pgm.s.pStatsR3; 1658 1659 PGM_REG_PROFILE(&pStats->StatAllocLargePage, "/PGM/LargePage/Prof/Alloc", "Time spent by the host OS for large page allocation."); 1660 PGM_REG_PROFILE(&pStats->StatClearLargePage, "/PGM/LargePage/Prof/Clear", "Time spent clearing the newly allocated large pages."); 1661 PGM_REG_PROFILE(&pStats->StatR3IsValidLargePage, "/PGM/LargePage/Prof/R3/IsValid", "pgmPhysIsValidLargePage profiling - R3."); 1662 PGM_REG_PROFILE(&pStats->StatRZIsValidLargePage, "/PGM/LargePage/Prof/RZ/IsValid", "pgmPhysIsValidLargePage profiling - RZ."); 1663 1664 PGM_REG_COUNTER(&pStats->StatR3DetectedConflicts, "/PGM/R3/DetectedConflicts", "The number of times PGMR3CheckMappingConflicts() detected a conflict."); 1665 PGM_REG_PROFILE(&pStats->StatR3ResolveConflict, "/PGM/R3/ResolveConflict", "pgmR3SyncPTResolveConflict() profiling (includes the entire relocation)."); 1666 PGM_REG_COUNTER(&pStats->StatR3PhysRead, "/PGM/R3/Phys/Read", "The number of times PGMPhysRead was called."); 1667 PGM_REG_COUNTER_BYTES(&pStats->StatR3PhysReadBytes, "/PGM/R3/Phys/Read/Bytes", "The number of bytes read by PGMPhysRead."); 1668 PGM_REG_COUNTER(&pStats->StatR3PhysWrite, "/PGM/R3/Phys/Write", "The number of times PGMPhysWrite was called."); 1669 PGM_REG_COUNTER_BYTES(&pStats->StatR3PhysWriteBytes, "/PGM/R3/Phys/Write/Bytes", "The number of bytes written by PGMPhysWrite."); 1670 PGM_REG_COUNTER(&pStats->StatR3PhysSimpleRead, "/PGM/R3/Phys/Simple/Read", "The number of times PGMPhysSimpleReadGCPtr was called."); 1671 PGM_REG_COUNTER_BYTES(&pStats->StatR3PhysSimpleReadBytes, "/PGM/R3/Phys/Simple/Read/Bytes", "The number of bytes read by PGMPhysSimpleReadGCPtr."); 1672 PGM_REG_COUNTER(&pStats->StatR3PhysSimpleWrite, "/PGM/R3/Phys/Simple/Write", "The number of times PGMPhysSimpleWriteGCPtr was called."); 1673 PGM_REG_COUNTER_BYTES(&pStats->StatR3PhysSimpleWriteBytes, "/PGM/R3/Phys/Simple/Write/Bytes", "The number of bytes written by PGMPhysSimpleWriteGCPtr."); 1674 1675 PGM_REG_COUNTER(&pStats->StatRZChunkR3MapTlbHits, "/PGM/ChunkR3Map/TlbHitsRZ", "TLB hits."); 1676 PGM_REG_COUNTER(&pStats->StatRZChunkR3MapTlbMisses, "/PGM/ChunkR3Map/TlbMissesRZ", "TLB misses."); 1677 PGM_REG_PROFILE(&pStats->StatChunkAging, "/PGM/ChunkR3Map/Map/Aging", "Chunk aging profiling."); 1678 PGM_REG_PROFILE(&pStats->StatChunkFindCandidate, "/PGM/ChunkR3Map/Map/Find", "Chunk unmap find profiling."); 1679 PGM_REG_PROFILE(&pStats->StatChunkUnmap, "/PGM/ChunkR3Map/Map/Unmap", "Chunk unmap of address space profiling."); 1680 PGM_REG_PROFILE(&pStats->StatChunkMap, "/PGM/ChunkR3Map/Map/Map", "Chunk map of address space profiling."); 1681 1682 PGM_REG_COUNTER(&pStats->StatRZPageMapTlbHits, "/PGM/RZ/Page/MapTlbHits", "TLB hits."); 1683 PGM_REG_COUNTER(&pStats->StatRZPageMapTlbMisses, "/PGM/RZ/Page/MapTlbMisses", "TLB misses."); 1684 PGM_REG_COUNTER(&pStats->StatR3ChunkR3MapTlbHits, "/PGM/ChunkR3Map/TlbHitsR3", "TLB hits."); 1685 PGM_REG_COUNTER(&pStats->StatR3ChunkR3MapTlbMisses, "/PGM/ChunkR3Map/TlbMissesR3", "TLB misses."); 1686 PGM_REG_COUNTER(&pStats->StatR3PageMapTlbHits, "/PGM/R3/Page/MapTlbHits", "TLB hits."); 1687 PGM_REG_COUNTER(&pStats->StatR3PageMapTlbMisses, "/PGM/R3/Page/MapTlbMisses", "TLB misses."); 1688 PGM_REG_COUNTER(&pStats->StatPageMapTlbFlushes, "/PGM/R3/Page/MapTlbFlushes", "TLB flushes (all contexts)."); 1689 PGM_REG_COUNTER(&pStats->StatPageMapTlbFlushEntry, "/PGM/R3/Page/MapTlbFlushEntry", "TLB entry flushes (all contexts)."); 1690 1691 PGM_REG_PROFILE(&pStats->StatRZSyncCR3HandlerVirtualUpdate, "/PGM/RZ/SyncCR3/Handlers/VirtualUpdate", "Profiling of the virtual handler updates."); 1692 PGM_REG_PROFILE(&pStats->StatRZSyncCR3HandlerVirtualReset, "/PGM/RZ/SyncCR3/Handlers/VirtualReset", "Profiling of the virtual handler resets."); 1693 PGM_REG_PROFILE(&pStats->StatR3SyncCR3HandlerVirtualUpdate, "/PGM/R3/SyncCR3/Handlers/VirtualUpdate", "Profiling of the virtual handler updates."); 1694 PGM_REG_PROFILE(&pStats->StatR3SyncCR3HandlerVirtualReset, "/PGM/R3/SyncCR3/Handlers/VirtualReset", "Profiling of the virtual handler resets."); 1695 1696 PGM_REG_COUNTER(&pStats->StatRZPhysHandlerReset, "/PGM/RZ/PhysHandlerReset", "The number of times PGMHandlerPhysicalReset is called."); 1697 PGM_REG_COUNTER(&pStats->StatR3PhysHandlerReset, "/PGM/R3/PhysHandlerReset", "The number of times PGMHandlerPhysicalReset is called."); 1698 PGM_REG_PROFILE(&pStats->StatRZVirtHandlerSearchByPhys, "/PGM/RZ/VirtHandlerSearchByPhys", "Profiling of pgmHandlerVirtualFindByPhysAddr."); 1699 PGM_REG_PROFILE(&pStats->StatR3VirtHandlerSearchByPhys, "/PGM/R3/VirtHandlerSearchByPhys", "Profiling of pgmHandlerVirtualFindByPhysAddr."); 1700 1701 PGM_REG_COUNTER(&pStats->StatRZPageReplaceShared, "/PGM/RZ/Page/ReplacedShared", "Times a shared page was replaced."); 1702 PGM_REG_COUNTER(&pStats->StatRZPageReplaceZero, "/PGM/RZ/Page/ReplacedZero", "Times the zero page was replaced."); 1703 /// @todo PGM_REG_COUNTER(&pStats->StatRZPageHandyAllocs, "/PGM/RZ/Page/HandyAllocs", "Number of times we've allocated more handy pages."); 1704 PGM_REG_COUNTER(&pStats->StatR3PageReplaceShared, "/PGM/R3/Page/ReplacedShared", "Times a shared page was replaced."); 1705 PGM_REG_COUNTER(&pStats->StatR3PageReplaceZero, "/PGM/R3/Page/ReplacedZero", "Times the zero page was replaced."); 1706 /// @todo PGM_REG_COUNTER(&pStats->StatR3PageHandyAllocs, "/PGM/R3/Page/HandyAllocs", "Number of times we've allocated more handy pages."); 1707 1708 PGM_REG_COUNTER(&pStats->StatRZPhysRead, "/PGM/RZ/Phys/Read", "The number of times PGMPhysRead was called."); 1709 PGM_REG_COUNTER_BYTES(&pStats->StatRZPhysReadBytes, "/PGM/RZ/Phys/Read/Bytes", "The number of bytes read by PGMPhysRead."); 1710 PGM_REG_COUNTER(&pStats->StatRZPhysWrite, "/PGM/RZ/Phys/Write", "The number of times PGMPhysWrite was called."); 1711 PGM_REG_COUNTER_BYTES(&pStats->StatRZPhysWriteBytes, "/PGM/RZ/Phys/Write/Bytes", "The number of bytes written by PGMPhysWrite."); 1712 PGM_REG_COUNTER(&pStats->StatRZPhysSimpleRead, "/PGM/RZ/Phys/Simple/Read", "The number of times PGMPhysSimpleReadGCPtr was called."); 1713 PGM_REG_COUNTER_BYTES(&pStats->StatRZPhysSimpleReadBytes, "/PGM/RZ/Phys/Simple/Read/Bytes", "The number of bytes read by PGMPhysSimpleReadGCPtr."); 1714 PGM_REG_COUNTER(&pStats->StatRZPhysSimpleWrite, "/PGM/RZ/Phys/Simple/Write", "The number of times PGMPhysSimpleWriteGCPtr was called."); 1715 PGM_REG_COUNTER_BYTES(&pStats->StatRZPhysSimpleWriteBytes, "/PGM/RZ/Phys/Simple/Write/Bytes", "The number of bytes written by PGMPhysSimpleWriteGCPtr."); 1686 1716 1687 1717 /* GC only: */ 1688 PGM_REG_COUNTER(&p PGM->StatRCDynMapCacheHits, "/PGM/RC/DynMapCache/Hits" , "Number of dynamic page mapping cache hits.");1689 PGM_REG_COUNTER(&p PGM->StatRCDynMapCacheMisses, "/PGM/RC/DynMapCache/Misses" , "Number of dynamic page mapping cache misses.");1690 PGM_REG_COUNTER(&p PGM->StatRCInvlPgConflict, "/PGM/RC/InvlPgConflict", "Number of times PGMInvalidatePage() detected a mapping conflict.");1691 PGM_REG_COUNTER(&p PGM->StatRCInvlPgSyncMonCR3, "/PGM/RC/InvlPgSyncMonitorCR3", "Number of times PGMInvalidatePage() ran into PGM_SYNC_MONITOR_CR3.");1692 1693 PGM_REG_COUNTER(&p PGM->StatRCPhysRead, "/PGM/RC/Phys/Read", "The number of times PGMPhysRead was called.");1694 PGM_REG_COUNTER_BYTES(&p PGM->StatRCPhysReadBytes, "/PGM/RC/Phys/Read/Bytes", "The number of bytes read by PGMPhysRead.");1695 PGM_REG_COUNTER(&p PGM->StatRCPhysWrite, "/PGM/RC/Phys/Write", "The number of times PGMPhysWrite was called.");1696 PGM_REG_COUNTER_BYTES(&p PGM->StatRCPhysWriteBytes, "/PGM/RC/Phys/Write/Bytes", "The number of bytes written by PGMPhysWrite.");1697 PGM_REG_COUNTER(&p PGM->StatRCPhysSimpleRead, "/PGM/RC/Phys/Simple/Read", "The number of times PGMPhysSimpleReadGCPtr was called.");1698 PGM_REG_COUNTER_BYTES(&p PGM->StatRCPhysSimpleReadBytes, "/PGM/RC/Phys/Simple/Read/Bytes", "The number of bytes read by PGMPhysSimpleReadGCPtr.");1699 PGM_REG_COUNTER(&p PGM->StatRCPhysSimpleWrite, "/PGM/RC/Phys/Simple/Write", "The number of times PGMPhysSimpleWriteGCPtr was called.");1700 PGM_REG_COUNTER_BYTES(&p PGM->StatRCPhysSimpleWriteBytes, "/PGM/RC/Phys/Simple/Write/Bytes", "The number of bytes written by PGMPhysSimpleWriteGCPtr.");1701 1702 PGM_REG_COUNTER(&p PGM->StatTrackVirgin, "/PGM/Track/Virgin", "The number of first time shadowings");1703 PGM_REG_COUNTER(&p PGM->StatTrackAliased, "/PGM/Track/Aliased", "The number of times switching to cRef2, i.e. the page is being shadowed by two PTs.");1704 PGM_REG_COUNTER(&p PGM->StatTrackAliasedMany, "/PGM/Track/AliasedMany", "The number of times we're tracking using cRef2.");1705 PGM_REG_COUNTER(&p PGM->StatTrackAliasedLots, "/PGM/Track/AliasedLots", "The number of times we're hitting pages which has overflowed cRef2");1706 PGM_REG_COUNTER(&p PGM->StatTrackOverflows, "/PGM/Track/Overflows", "The number of times the extent list grows too long.");1707 PGM_REG_COUNTER(&p PGM->StatTrackNoExtentsLeft, "/PGM/Track/NoExtentLeft", "The number of times the extent list was exhausted.");1708 PGM_REG_PROFILE(&p PGM->StatTrackDeref, "/PGM/Track/Deref", "Profiling of SyncPageWorkerTrackDeref (expensive).");1718 PGM_REG_COUNTER(&pStats->StatRCDynMapCacheHits, "/PGM/RC/DynMapCache/Hits" , "Number of dynamic page mapping cache hits."); 1719 PGM_REG_COUNTER(&pStats->StatRCDynMapCacheMisses, "/PGM/RC/DynMapCache/Misses" , "Number of dynamic page mapping cache misses."); 1720 PGM_REG_COUNTER(&pStats->StatRCInvlPgConflict, "/PGM/RC/InvlPgConflict", "Number of times PGMInvalidatePage() detected a mapping conflict."); 1721 PGM_REG_COUNTER(&pStats->StatRCInvlPgSyncMonCR3, "/PGM/RC/InvlPgSyncMonitorCR3", "Number of times PGMInvalidatePage() ran into PGM_SYNC_MONITOR_CR3."); 1722 1723 PGM_REG_COUNTER(&pStats->StatRCPhysRead, "/PGM/RC/Phys/Read", "The number of times PGMPhysRead was called."); 1724 PGM_REG_COUNTER_BYTES(&pStats->StatRCPhysReadBytes, "/PGM/RC/Phys/Read/Bytes", "The number of bytes read by PGMPhysRead."); 1725 PGM_REG_COUNTER(&pStats->StatRCPhysWrite, "/PGM/RC/Phys/Write", "The number of times PGMPhysWrite was called."); 1726 PGM_REG_COUNTER_BYTES(&pStats->StatRCPhysWriteBytes, "/PGM/RC/Phys/Write/Bytes", "The number of bytes written by PGMPhysWrite."); 1727 PGM_REG_COUNTER(&pStats->StatRCPhysSimpleRead, "/PGM/RC/Phys/Simple/Read", "The number of times PGMPhysSimpleReadGCPtr was called."); 1728 PGM_REG_COUNTER_BYTES(&pStats->StatRCPhysSimpleReadBytes, "/PGM/RC/Phys/Simple/Read/Bytes", "The number of bytes read by PGMPhysSimpleReadGCPtr."); 1729 PGM_REG_COUNTER(&pStats->StatRCPhysSimpleWrite, "/PGM/RC/Phys/Simple/Write", "The number of times PGMPhysSimpleWriteGCPtr was called."); 1730 PGM_REG_COUNTER_BYTES(&pStats->StatRCPhysSimpleWriteBytes, "/PGM/RC/Phys/Simple/Write/Bytes", "The number of bytes written by PGMPhysSimpleWriteGCPtr."); 1731 1732 PGM_REG_COUNTER(&pStats->StatTrackVirgin, "/PGM/Track/Virgin", "The number of first time shadowings"); 1733 PGM_REG_COUNTER(&pStats->StatTrackAliased, "/PGM/Track/Aliased", "The number of times switching to cRef2, i.e. the page is being shadowed by two PTs."); 1734 PGM_REG_COUNTER(&pStats->StatTrackAliasedMany, "/PGM/Track/AliasedMany", "The number of times we're tracking using cRef2."); 1735 PGM_REG_COUNTER(&pStats->StatTrackAliasedLots, "/PGM/Track/AliasedLots", "The number of times we're hitting pages which has overflowed cRef2"); 1736 PGM_REG_COUNTER(&pStats->StatTrackOverflows, "/PGM/Track/Overflows", "The number of times the extent list grows too long."); 1737 PGM_REG_COUNTER(&pStats->StatTrackNoExtentsLeft, "/PGM/Track/NoExtentLeft", "The number of times the extent list was exhausted."); 1738 PGM_REG_PROFILE(&pStats->StatTrackDeref, "/PGM/Track/Deref", "Profiling of SyncPageWorkerTrackDeref (expensive)."); 1709 1739 1710 1740 # undef PGM_REG_COUNTER … … 1724 1754 1725 1755 #define PGM_REG_COUNTER(a, b, c) \ 1726 1727 1756 rc = STAMR3RegisterF(pVM, a, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, c, b, idCpu); \ 1757 AssertRC(rc); 1728 1758 #define PGM_REG_PROFILE(a, b, c) \ 1729 1730 1759 rc = STAMR3RegisterF(pVM, a, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, c, b, idCpu); \ 1760 AssertRC(rc); 1731 1761 1732 1762 PGM_REG_COUNTER(&pPgmCpu->cGuestModeChanges, "/PGM/CPU%u/cGuestModeChanges", "Number of guest mode changes."); 1733 1763 1734 1764 #ifdef VBOX_WITH_STATISTICS 1765 PGMCPUSTATS *pCpuStats = pVM->aCpus[idCpu].pgm.s.pStatsR3; 1735 1766 1736 1767 # if 0 /* rarely useful; leave for debugging. */ 1737 1768 for (unsigned j = 0; j < RT_ELEMENTS(pPgmCpu->StatSyncPtPD); j++) 1738 STAMR3RegisterF(pVM, &p PgmCpu->StatSyncPtPD[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,1769 STAMR3RegisterF(pVM, &pCpuStats->StatSyncPtPD[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1739 1770 "The number of SyncPT per PD n.", "/PGM/CPU%u/PDSyncPT/%04X", i, j); 1740 for (unsigned j = 0; j < RT_ELEMENTS(p PgmCpu->StatSyncPagePD); j++)1741 STAMR3RegisterF(pVM, &p PgmCpu->StatSyncPagePD[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,1771 for (unsigned j = 0; j < RT_ELEMENTS(pCpuStats->StatSyncPagePD); j++) 1772 STAMR3RegisterF(pVM, &pCpuStats->StatSyncPagePD[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1742 1773 "The number of SyncPage per PD n.", "/PGM/CPU%u/PDSyncPage/%04X", i, j); 1743 1774 # endif 1744 1775 /* R0 only: */ 1745 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapMigrateInvlPg, "/PGM/CPU%u/R0/DynMapMigrateInvlPg", "invlpg count in PGMDynMapMigrateAutoSet.");1746 PGM_REG_PROFILE(&p PgmCpu->StatR0DynMapGCPageInl, "/PGM/CPU%u/R0/DynMapPageGCPageInl", "Calls to pgmR0DynMapGCPageInlined.");1747 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapGCPageInlHits, "/PGM/CPU%u/R0/DynMapPageGCPageInl/Hits", "Hash table lookup hits.");1748 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapGCPageInlMisses, "/PGM/CPU%u/R0/DynMapPageGCPageInl/Misses", "Misses that falls back to code common with PGMDynMapHCPage.");1749 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapGCPageInlRamHits, "/PGM/CPU%u/R0/DynMapPageGCPageInl/RamHits", "1st ram range hits.");1750 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapGCPageInlRamMisses, "/PGM/CPU%u/R0/DynMapPageGCPageInl/RamMisses", "1st ram range misses, takes slow path.");1751 PGM_REG_PROFILE(&p PgmCpu->StatR0DynMapHCPageInl, "/PGM/CPU%u/R0/DynMapPageHCPageInl", "Calls to pgmR0DynMapHCPageInlined.");1752 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapHCPageInlHits, "/PGM/CPU%u/R0/DynMapPageHCPageInl/Hits", "Hash table lookup hits.");1753 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapHCPageInlMisses, "/PGM/CPU%u/R0/DynMapPageHCPageInl/Misses", "Misses that falls back to code common with PGMDynMapHCPage.");1754 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPage, "/PGM/CPU%u/R0/DynMapPage", "Calls to pgmR0DynMapPage");1755 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapSetOptimize, "/PGM/CPU%u/R0/DynMapPage/SetOptimize", "Calls to pgmDynMapOptimizeAutoSet.");1756 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapSetSearchFlushes, "/PGM/CPU%u/R0/DynMapPage/SetSearchFlushes","Set search restorting to subset flushes.");1757 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapSetSearchHits, "/PGM/CPU%u/R0/DynMapPage/SetSearchHits", "Set search hits.");1758 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapSetSearchMisses, "/PGM/CPU%u/R0/DynMapPage/SetSearchMisses", "Set search misses.");1759 PGM_REG_PROFILE(&p PgmCpu->StatR0DynMapHCPage, "/PGM/CPU%u/R0/DynMapPage/HCPage", "Calls to PGMDynMapHCPage (ring-0).");1760 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageHits0, "/PGM/CPU%u/R0/DynMapPage/Hits0", "Hits at iPage+0");1761 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageHits1, "/PGM/CPU%u/R0/DynMapPage/Hits1", "Hits at iPage+1");1762 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageHits2, "/PGM/CPU%u/R0/DynMapPage/Hits2", "Hits at iPage+2");1763 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageInvlPg, "/PGM/CPU%u/R0/DynMapPage/InvlPg", "invlpg count in pgmR0DynMapPageSlow.");1764 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageSlow, "/PGM/CPU%u/R0/DynMapPage/Slow", "Calls to pgmR0DynMapPageSlow - subtract this from pgmR0DynMapPage to get 1st level hits.");1765 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageSlowLoopHits, "/PGM/CPU%u/R0/DynMapPage/SlowLoopHits" , "Hits in the loop path.");1766 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageSlowLoopMisses, "/PGM/CPU%u/R0/DynMapPage/SlowLoopMisses", "Misses in the loop path. NonLoopMisses = Slow - SlowLoopHit - SlowLoopMisses");1767 //PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPageSlowLostHits, "/PGM/CPU%u/R0/DynMapPage/SlowLostHits", "Lost hits.");1768 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapSubsets, "/PGM/CPU%u/R0/Subsets", "Times PGMDynMapPushAutoSubset was called.");1769 PGM_REG_COUNTER(&p PgmCpu->StatR0DynMapPopFlushes, "/PGM/CPU%u/R0/SubsetPopFlushes", "Times PGMDynMapPopAutoSubset flushes the subset.");1770 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[0], "/PGM/CPU%u/R0/SetSize000..09", "00-09% filled");1771 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[1], "/PGM/CPU%u/R0/SetSize010..19", "10-19% filled");1772 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[2], "/PGM/CPU%u/R0/SetSize020..29", "20-29% filled");1773 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[3], "/PGM/CPU%u/R0/SetSize030..39", "30-39% filled");1774 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[4], "/PGM/CPU%u/R0/SetSize040..49", "40-49% filled");1775 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[5], "/PGM/CPU%u/R0/SetSize050..59", "50-59% filled");1776 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[6], "/PGM/CPU%u/R0/SetSize060..69", "60-69% filled");1777 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[7], "/PGM/CPU%u/R0/SetSize070..79", "70-79% filled");1778 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[8], "/PGM/CPU%u/R0/SetSize080..89", "80-89% filled");1779 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[9], "/PGM/CPU%u/R0/SetSize090..99", "90-99% filled");1780 PGM_REG_COUNTER(&p PgmCpu->aStatR0DynMapSetSize[10], "/PGM/CPU%u/R0/SetSize100", "100% filled");1776 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapMigrateInvlPg, "/PGM/CPU%u/R0/DynMapMigrateInvlPg", "invlpg count in PGMDynMapMigrateAutoSet."); 1777 PGM_REG_PROFILE(&pCpuStats->StatR0DynMapGCPageInl, "/PGM/CPU%u/R0/DynMapPageGCPageInl", "Calls to pgmR0DynMapGCPageInlined."); 1778 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapGCPageInlHits, "/PGM/CPU%u/R0/DynMapPageGCPageInl/Hits", "Hash table lookup hits."); 1779 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapGCPageInlMisses, "/PGM/CPU%u/R0/DynMapPageGCPageInl/Misses", "Misses that falls back to code common with PGMDynMapHCPage."); 1780 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapGCPageInlRamHits, "/PGM/CPU%u/R0/DynMapPageGCPageInl/RamHits", "1st ram range hits."); 1781 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapGCPageInlRamMisses, "/PGM/CPU%u/R0/DynMapPageGCPageInl/RamMisses", "1st ram range misses, takes slow path."); 1782 PGM_REG_PROFILE(&pCpuStats->StatR0DynMapHCPageInl, "/PGM/CPU%u/R0/DynMapPageHCPageInl", "Calls to pgmR0DynMapHCPageInlined."); 1783 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapHCPageInlHits, "/PGM/CPU%u/R0/DynMapPageHCPageInl/Hits", "Hash table lookup hits."); 1784 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapHCPageInlMisses, "/PGM/CPU%u/R0/DynMapPageHCPageInl/Misses", "Misses that falls back to code common with PGMDynMapHCPage."); 1785 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPage, "/PGM/CPU%u/R0/DynMapPage", "Calls to pgmR0DynMapPage"); 1786 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapSetOptimize, "/PGM/CPU%u/R0/DynMapPage/SetOptimize", "Calls to pgmDynMapOptimizeAutoSet."); 1787 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapSetSearchFlushes, "/PGM/CPU%u/R0/DynMapPage/SetSearchFlushes","Set search restorting to subset flushes."); 1788 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapSetSearchHits, "/PGM/CPU%u/R0/DynMapPage/SetSearchHits", "Set search hits."); 1789 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapSetSearchMisses, "/PGM/CPU%u/R0/DynMapPage/SetSearchMisses", "Set search misses."); 1790 PGM_REG_PROFILE(&pCpuStats->StatR0DynMapHCPage, "/PGM/CPU%u/R0/DynMapPage/HCPage", "Calls to PGMDynMapHCPage (ring-0)."); 1791 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageHits0, "/PGM/CPU%u/R0/DynMapPage/Hits0", "Hits at iPage+0"); 1792 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageHits1, "/PGM/CPU%u/R0/DynMapPage/Hits1", "Hits at iPage+1"); 1793 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageHits2, "/PGM/CPU%u/R0/DynMapPage/Hits2", "Hits at iPage+2"); 1794 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageInvlPg, "/PGM/CPU%u/R0/DynMapPage/InvlPg", "invlpg count in pgmR0DynMapPageSlow."); 1795 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageSlow, "/PGM/CPU%u/R0/DynMapPage/Slow", "Calls to pgmR0DynMapPageSlow - subtract this from pgmR0DynMapPage to get 1st level hits."); 1796 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageSlowLoopHits, "/PGM/CPU%u/R0/DynMapPage/SlowLoopHits" , "Hits in the loop path."); 1797 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageSlowLoopMisses, "/PGM/CPU%u/R0/DynMapPage/SlowLoopMisses", "Misses in the loop path. NonLoopMisses = Slow - SlowLoopHit - SlowLoopMisses"); 1798 //PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPageSlowLostHits, "/PGM/CPU%u/R0/DynMapPage/SlowLostHits", "Lost hits."); 1799 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapSubsets, "/PGM/CPU%u/R0/Subsets", "Times PGMDynMapPushAutoSubset was called."); 1800 PGM_REG_COUNTER(&pCpuStats->StatR0DynMapPopFlushes, "/PGM/CPU%u/R0/SubsetPopFlushes", "Times PGMDynMapPopAutoSubset flushes the subset."); 1801 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[0], "/PGM/CPU%u/R0/SetSize000..09", "00-09% filled"); 1802 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[1], "/PGM/CPU%u/R0/SetSize010..19", "10-19% filled"); 1803 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[2], "/PGM/CPU%u/R0/SetSize020..29", "20-29% filled"); 1804 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[3], "/PGM/CPU%u/R0/SetSize030..39", "30-39% filled"); 1805 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[4], "/PGM/CPU%u/R0/SetSize040..49", "40-49% filled"); 1806 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[5], "/PGM/CPU%u/R0/SetSize050..59", "50-59% filled"); 1807 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[6], "/PGM/CPU%u/R0/SetSize060..69", "60-69% filled"); 1808 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[7], "/PGM/CPU%u/R0/SetSize070..79", "70-79% filled"); 1809 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[8], "/PGM/CPU%u/R0/SetSize080..89", "80-89% filled"); 1810 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[9], "/PGM/CPU%u/R0/SetSize090..99", "90-99% filled"); 1811 PGM_REG_COUNTER(&pCpuStats->aStatR0DynMapSetSize[10], "/PGM/CPU%u/R0/SetSize100", "100% filled"); 1781 1812 1782 1813 /* RZ only: */ 1783 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0e, "/PGM/CPU%u/RZ/Trap0e", "Profiling of the PGMTrap0eHandler() body.");1784 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2Ballooned, "/PGM/CPU%u/RZ/Trap0e/Time2/Ballooned", "Profiling of the Trap0eHandler body when the cause is read access to a ballooned page.");1785 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2CSAM, "/PGM/CPU%u/RZ/Trap0e/Time2/CSAM", "Profiling of the Trap0eHandler body when the cause is CSAM.");1786 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2DirtyAndAccessed, "/PGM/CPU%u/RZ/Trap0e/Time2/DirtyAndAccessedBits", "Profiling of the Trap0eHandler body when the cause is dirty and/or accessed bit emulation.");1787 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2GuestTrap, "/PGM/CPU%u/RZ/Trap0e/Time2/GuestTrap", "Profiling of the Trap0eHandler body when the cause is a guest trap.");1788 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2HndPhys, "/PGM/CPU%u/RZ/Trap0e/Time2/HandlerPhysical", "Profiling of the Trap0eHandler body when the cause is a physical handler.");1789 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2HndVirt, "/PGM/CPU%u/RZ/Trap0e/Time2/HandlerVirtual", "Profiling of the Trap0eHandler body when the cause is a virtual handler.");1790 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2HndUnhandled, "/PGM/CPU%u/RZ/Trap0e/Time2/HandlerUnhandled", "Profiling of the Trap0eHandler body when the cause is access outside the monitored areas of a monitored page.");1791 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2InvalidPhys, "/PGM/CPU%u/RZ/Trap0e/Time2/InvalidPhys", "Profiling of the Trap0eHandler body when the cause is access to an invalid physical guest address.");1792 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2MakeWritable, "/PGM/CPU%u/RZ/Trap0e/Time2/MakeWritable", "Profiling of the Trap0eHandler body when the cause is that a page needed to be made writeable.");1793 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2Mapping, "/PGM/CPU%u/RZ/Trap0e/Time2/Mapping", "Profiling of the Trap0eHandler body when the cause is releated to the guest mappings.");1794 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2Misc, "/PGM/CPU%u/RZ/Trap0e/Time2/Misc", "Profiling of the Trap0eHandler body when the cause is not known.");1795 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2OutOfSync, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSync", "Profiling of the Trap0eHandler body when the cause is an out-of-sync page.");1796 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2OutOfSyncHndPhys, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSyncHndPhys", "Profiling of the Trap0eHandler body when the cause is an out-of-sync physical handler page.");1797 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2OutOfSyncHndVirt, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSyncHndVirt", "Profiling of the Trap0eHandler body when the cause is an out-of-sync virtual handler page.");1798 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2OutOfSyncHndObs, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSyncObsHnd", "Profiling of the Trap0eHandler body when the cause is an obsolete handler page.");1799 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2SyncPT, "/PGM/CPU%u/RZ/Trap0e/Time2/SyncPT", "Profiling of the Trap0eHandler body when the cause is lazy syncing of a PT.");1800 PGM_REG_PROFILE(&p PgmCpu->StatRZTrap0eTime2WPEmulation, "/PGM/CPU%u/RZ/Trap0e/Time2/WPEmulation", "Profiling of the Trap0eHandler body when the cause is CR0.WP emulation.");1801 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eConflicts, "/PGM/CPU%u/RZ/Trap0e/Conflicts", "The number of times #PF was caused by an undetected conflict.");1802 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersMapping, "/PGM/CPU%u/RZ/Trap0e/Handlers/Mapping", "Number of traps due to access handlers in mappings.");1803 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersOutOfSync, "/PGM/CPU%u/RZ/Trap0e/Handlers/OutOfSync", "Number of traps due to out-of-sync handled pages.");1804 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersPhysical, "/PGM/CPU%u/RZ/Trap0e/Handlers/Physical", "Number of traps due to physical access handlers.");1805 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersVirtual, "/PGM/CPU%u/RZ/Trap0e/Handlers/Virtual", "Number of traps due to virtual access handlers.");1806 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersVirtualByPhys, "/PGM/CPU%u/RZ/Trap0e/Handlers/VirtualByPhys", "Number of traps due to virtual access handlers by physical address.");1807 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersVirtualUnmarked,"/PGM/CPU%u/RZ/Trap0e/Handlers/VirtualUnmarked","Number of traps due to virtual access handlers by virtual address (without proper physical flags).");1808 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersUnhandled, "/PGM/CPU%u/RZ/Trap0e/Handlers/Unhandled", "Number of traps due to access outside range of monitored page(s).");1809 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eHandlersInvalid, "/PGM/CPU%u/RZ/Trap0e/Handlers/Invalid", "Number of traps due to access to invalid physical memory.");1810 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eUSNotPresentRead, "/PGM/CPU%u/RZ/Trap0e/Err/User/NPRead", "Number of user mode not present read page faults.");1811 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eUSNotPresentWrite, "/PGM/CPU%u/RZ/Trap0e/Err/User/NPWrite", "Number of user mode not present write page faults.");1812 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eUSWrite, "/PGM/CPU%u/RZ/Trap0e/Err/User/Write", "Number of user mode write page faults.");1813 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eUSReserved, "/PGM/CPU%u/RZ/Trap0e/Err/User/Reserved", "Number of user mode reserved bit page faults.");1814 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eUSNXE, "/PGM/CPU%u/RZ/Trap0e/Err/User/NXE", "Number of user mode NXE page faults.");1815 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eUSRead, "/PGM/CPU%u/RZ/Trap0e/Err/User/Read", "Number of user mode read page faults.");1816 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eSVNotPresentRead, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/NPRead", "Number of supervisor mode not present read page faults.");1817 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eSVNotPresentWrite, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/NPWrite", "Number of supervisor mode not present write page faults.");1818 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eSVWrite, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/Write", "Number of supervisor mode write page faults.");1819 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eSVReserved, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/Reserved", "Number of supervisor mode reserved bit page faults.");1820 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eSNXE, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/NXE", "Number of supervisor mode NXE page faults.");1821 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eGuestPF, "/PGM/CPU%u/RZ/Trap0e/GuestPF", "Number of real guest page faults.");1822 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eGuestPFUnh, "/PGM/CPU%u/RZ/Trap0e/GuestPF/Unhandled", "Number of real guest page faults from the 'unhandled' case.");1823 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eGuestPFMapping, "/PGM/CPU%u/RZ/Trap0e/GuestPF/InMapping", "Number of real guest page faults in a mapping.");1824 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eWPEmulInRZ, "/PGM/CPU%u/RZ/Trap0e/WP/InRZ", "Number of guest page faults due to X86_CR0_WP emulation.");1825 PGM_REG_COUNTER(&p PgmCpu->StatRZTrap0eWPEmulToR3, "/PGM/CPU%u/RZ/Trap0e/WP/ToR3", "Number of guest page faults due to X86_CR0_WP emulation (forward to R3 for emulation).");1814 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0e, "/PGM/CPU%u/RZ/Trap0e", "Profiling of the PGMTrap0eHandler() body."); 1815 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2Ballooned, "/PGM/CPU%u/RZ/Trap0e/Time2/Ballooned", "Profiling of the Trap0eHandler body when the cause is read access to a ballooned page."); 1816 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2CSAM, "/PGM/CPU%u/RZ/Trap0e/Time2/CSAM", "Profiling of the Trap0eHandler body when the cause is CSAM."); 1817 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2DirtyAndAccessed, "/PGM/CPU%u/RZ/Trap0e/Time2/DirtyAndAccessedBits", "Profiling of the Trap0eHandler body when the cause is dirty and/or accessed bit emulation."); 1818 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2GuestTrap, "/PGM/CPU%u/RZ/Trap0e/Time2/GuestTrap", "Profiling of the Trap0eHandler body when the cause is a guest trap."); 1819 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2HndPhys, "/PGM/CPU%u/RZ/Trap0e/Time2/HandlerPhysical", "Profiling of the Trap0eHandler body when the cause is a physical handler."); 1820 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2HndVirt, "/PGM/CPU%u/RZ/Trap0e/Time2/HandlerVirtual", "Profiling of the Trap0eHandler body when the cause is a virtual handler."); 1821 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2HndUnhandled, "/PGM/CPU%u/RZ/Trap0e/Time2/HandlerUnhandled", "Profiling of the Trap0eHandler body when the cause is access outside the monitored areas of a monitored page."); 1822 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2InvalidPhys, "/PGM/CPU%u/RZ/Trap0e/Time2/InvalidPhys", "Profiling of the Trap0eHandler body when the cause is access to an invalid physical guest address."); 1823 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2MakeWritable, "/PGM/CPU%u/RZ/Trap0e/Time2/MakeWritable", "Profiling of the Trap0eHandler body when the cause is that a page needed to be made writeable."); 1824 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2Mapping, "/PGM/CPU%u/RZ/Trap0e/Time2/Mapping", "Profiling of the Trap0eHandler body when the cause is releated to the guest mappings."); 1825 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2Misc, "/PGM/CPU%u/RZ/Trap0e/Time2/Misc", "Profiling of the Trap0eHandler body when the cause is not known."); 1826 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2OutOfSync, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSync", "Profiling of the Trap0eHandler body when the cause is an out-of-sync page."); 1827 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2OutOfSyncHndPhys, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSyncHndPhys", "Profiling of the Trap0eHandler body when the cause is an out-of-sync physical handler page."); 1828 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2OutOfSyncHndVirt, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSyncHndVirt", "Profiling of the Trap0eHandler body when the cause is an out-of-sync virtual handler page."); 1829 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2OutOfSyncHndObs, "/PGM/CPU%u/RZ/Trap0e/Time2/OutOfSyncObsHnd", "Profiling of the Trap0eHandler body when the cause is an obsolete handler page."); 1830 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2SyncPT, "/PGM/CPU%u/RZ/Trap0e/Time2/SyncPT", "Profiling of the Trap0eHandler body when the cause is lazy syncing of a PT."); 1831 PGM_REG_PROFILE(&pCpuStats->StatRZTrap0eTime2WPEmulation, "/PGM/CPU%u/RZ/Trap0e/Time2/WPEmulation", "Profiling of the Trap0eHandler body when the cause is CR0.WP emulation."); 1832 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eConflicts, "/PGM/CPU%u/RZ/Trap0e/Conflicts", "The number of times #PF was caused by an undetected conflict."); 1833 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersMapping, "/PGM/CPU%u/RZ/Trap0e/Handlers/Mapping", "Number of traps due to access handlers in mappings."); 1834 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersOutOfSync, "/PGM/CPU%u/RZ/Trap0e/Handlers/OutOfSync", "Number of traps due to out-of-sync handled pages."); 1835 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersPhysical, "/PGM/CPU%u/RZ/Trap0e/Handlers/Physical", "Number of traps due to physical access handlers."); 1836 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersVirtual, "/PGM/CPU%u/RZ/Trap0e/Handlers/Virtual", "Number of traps due to virtual access handlers."); 1837 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersVirtualByPhys, "/PGM/CPU%u/RZ/Trap0e/Handlers/VirtualByPhys", "Number of traps due to virtual access handlers by physical address."); 1838 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersVirtualUnmarked,"/PGM/CPU%u/RZ/Trap0e/Handlers/VirtualUnmarked","Number of traps due to virtual access handlers by virtual address (without proper physical flags)."); 1839 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersUnhandled, "/PGM/CPU%u/RZ/Trap0e/Handlers/Unhandled", "Number of traps due to access outside range of monitored page(s)."); 1840 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eHandlersInvalid, "/PGM/CPU%u/RZ/Trap0e/Handlers/Invalid", "Number of traps due to access to invalid physical memory."); 1841 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eUSNotPresentRead, "/PGM/CPU%u/RZ/Trap0e/Err/User/NPRead", "Number of user mode not present read page faults."); 1842 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eUSNotPresentWrite, "/PGM/CPU%u/RZ/Trap0e/Err/User/NPWrite", "Number of user mode not present write page faults."); 1843 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eUSWrite, "/PGM/CPU%u/RZ/Trap0e/Err/User/Write", "Number of user mode write page faults."); 1844 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eUSReserved, "/PGM/CPU%u/RZ/Trap0e/Err/User/Reserved", "Number of user mode reserved bit page faults."); 1845 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eUSNXE, "/PGM/CPU%u/RZ/Trap0e/Err/User/NXE", "Number of user mode NXE page faults."); 1846 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eUSRead, "/PGM/CPU%u/RZ/Trap0e/Err/User/Read", "Number of user mode read page faults."); 1847 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eSVNotPresentRead, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/NPRead", "Number of supervisor mode not present read page faults."); 1848 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eSVNotPresentWrite, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/NPWrite", "Number of supervisor mode not present write page faults."); 1849 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eSVWrite, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/Write", "Number of supervisor mode write page faults."); 1850 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eSVReserved, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/Reserved", "Number of supervisor mode reserved bit page faults."); 1851 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eSNXE, "/PGM/CPU%u/RZ/Trap0e/Err/Supervisor/NXE", "Number of supervisor mode NXE page faults."); 1852 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eGuestPF, "/PGM/CPU%u/RZ/Trap0e/GuestPF", "Number of real guest page faults."); 1853 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eGuestPFUnh, "/PGM/CPU%u/RZ/Trap0e/GuestPF/Unhandled", "Number of real guest page faults from the 'unhandled' case."); 1854 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eGuestPFMapping, "/PGM/CPU%u/RZ/Trap0e/GuestPF/InMapping", "Number of real guest page faults in a mapping."); 1855 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eWPEmulInRZ, "/PGM/CPU%u/RZ/Trap0e/WP/InRZ", "Number of guest page faults due to X86_CR0_WP emulation."); 1856 PGM_REG_COUNTER(&pCpuStats->StatRZTrap0eWPEmulToR3, "/PGM/CPU%u/RZ/Trap0e/WP/ToR3", "Number of guest page faults due to X86_CR0_WP emulation (forward to R3 for emulation)."); 1826 1857 #if 0 /* rarely useful; leave for debugging. */ 1827 for (unsigned j = 0; j < RT_ELEMENTS(p PgmCpu->StatRZTrap0ePD); j++)1828 STAMR3RegisterF(pVM, &p PgmCpu->StatRZTrap0ePD[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES,1858 for (unsigned j = 0; j < RT_ELEMENTS(pCpuStats->StatRZTrap0ePD); j++) 1859 STAMR3RegisterF(pVM, &pCpuStats->StatRZTrap0ePD[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED, STAMUNIT_OCCURENCES, 1829 1860 "The number of traps in page directory n.", "/PGM/CPU%u/RZ/Trap0e/PD/%04X", i, j); 1830 1861 #endif 1831 PGM_REG_COUNTER(&p PgmCpu->StatRZGuestCR3WriteHandled, "/PGM/CPU%u/RZ/CR3WriteHandled", "The number of times the Guest CR3 change was successfully handled.");1832 PGM_REG_COUNTER(&p PgmCpu->StatRZGuestCR3WriteUnhandled, "/PGM/CPU%u/RZ/CR3WriteUnhandled", "The number of times the Guest CR3 change was passed back to the recompiler.");1833 PGM_REG_COUNTER(&p PgmCpu->StatRZGuestCR3WriteConflict, "/PGM/CPU%u/RZ/CR3WriteConflict", "The number of times the Guest CR3 monitoring detected a conflict.");1834 PGM_REG_COUNTER(&p PgmCpu->StatRZGuestROMWriteHandled, "/PGM/CPU%u/RZ/ROMWriteHandled", "The number of times the Guest ROM change was successfully handled.");1835 PGM_REG_COUNTER(&p PgmCpu->StatRZGuestROMWriteUnhandled, "/PGM/CPU%u/RZ/ROMWriteUnhandled", "The number of times the Guest ROM change was passed back to the recompiler.");1862 PGM_REG_COUNTER(&pCpuStats->StatRZGuestCR3WriteHandled, "/PGM/CPU%u/RZ/CR3WriteHandled", "The number of times the Guest CR3 change was successfully handled."); 1863 PGM_REG_COUNTER(&pCpuStats->StatRZGuestCR3WriteUnhandled, "/PGM/CPU%u/RZ/CR3WriteUnhandled", "The number of times the Guest CR3 change was passed back to the recompiler."); 1864 PGM_REG_COUNTER(&pCpuStats->StatRZGuestCR3WriteConflict, "/PGM/CPU%u/RZ/CR3WriteConflict", "The number of times the Guest CR3 monitoring detected a conflict."); 1865 PGM_REG_COUNTER(&pCpuStats->StatRZGuestROMWriteHandled, "/PGM/CPU%u/RZ/ROMWriteHandled", "The number of times the Guest ROM change was successfully handled."); 1866 PGM_REG_COUNTER(&pCpuStats->StatRZGuestROMWriteUnhandled, "/PGM/CPU%u/RZ/ROMWriteUnhandled", "The number of times the Guest ROM change was passed back to the recompiler."); 1836 1867 1837 1868 /* HC only: */ 1838 1869 1839 1870 /* RZ & R3: */ 1840 PGM_REG_PROFILE(&p PgmCpu->StatRZSyncCR3, "/PGM/CPU%u/RZ/SyncCR3", "Profiling of the PGMSyncCR3() body.");1841 PGM_REG_PROFILE(&p PgmCpu->StatRZSyncCR3Handlers, "/PGM/CPU%u/RZ/SyncCR3/Handlers", "Profiling of the PGMSyncCR3() update handler section.");1842 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3Global, "/PGM/CPU%u/RZ/SyncCR3/Global", "The number of global CR3 syncs.");1843 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3NotGlobal, "/PGM/CPU%u/RZ/SyncCR3/NotGlobal", "The number of non-global CR3 syncs.");1844 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3DstCacheHit, "/PGM/CPU%u/RZ/SyncCR3/DstChacheHit", "The number of times we got some kind of a cache hit.");1845 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3DstFreed, "/PGM/CPU%u/RZ/SyncCR3/DstFreed", "The number of times we've had to free a shadow entry.");1846 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3DstFreedSrcNP, "/PGM/CPU%u/RZ/SyncCR3/DstFreedSrcNP", "The number of times we've had to free a shadow entry for which the source entry was not present.");1847 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3DstNotPresent, "/PGM/CPU%u/RZ/SyncCR3/DstNotPresent", "The number of times we've encountered a not present shadow entry for a present guest entry.");1848 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3DstSkippedGlobalPD, "/PGM/CPU%u/RZ/SyncCR3/DstSkippedGlobalPD", "The number of times a global page directory wasn't flushed.");1849 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncCR3DstSkippedGlobalPT, "/PGM/CPU%u/RZ/SyncCR3/DstSkippedGlobalPT", "The number of times a page table with only global entries wasn't flushed.");1850 PGM_REG_PROFILE(&p PgmCpu->StatRZSyncPT, "/PGM/CPU%u/RZ/SyncPT", "Profiling of the pfnSyncPT() body.");1851 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncPTFailed, "/PGM/CPU%u/RZ/SyncPT/Failed", "The number of times pfnSyncPT() failed.");1852 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncPT4K, "/PGM/CPU%u/RZ/SyncPT/4K", "Nr of 4K PT syncs");1853 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncPT4M, "/PGM/CPU%u/RZ/SyncPT/4M", "Nr of 4M PT syncs");1854 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncPagePDNAs, "/PGM/CPU%u/RZ/SyncPagePDNAs", "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit.");1855 PGM_REG_COUNTER(&p PgmCpu->StatRZSyncPagePDOutOfSync, "/PGM/CPU%u/RZ/SyncPagePDOutOfSync", "The number of time we've encountered an out-of-sync PD in SyncPage.");1856 PGM_REG_COUNTER(&p PgmCpu->StatRZAccessedPage, "/PGM/CPU%u/RZ/AccessedPage", "The number of pages marked not present for accessed bit emulation.");1857 PGM_REG_PROFILE(&p PgmCpu->StatRZDirtyBitTracking, "/PGM/CPU%u/RZ/DirtyPage", "Profiling the dirty bit tracking in CheckPageFault().");1858 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtyPage, "/PGM/CPU%u/RZ/DirtyPage/Mark", "The number of pages marked read-only for dirty bit tracking.");1859 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtyPageBig, "/PGM/CPU%u/RZ/DirtyPage/MarkBig", "The number of 4MB pages marked read-only for dirty bit tracking.");1860 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtyPageSkipped, "/PGM/CPU%u/RZ/DirtyPage/Skipped", "The number of pages already dirty or readonly.");1861 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtyPageTrap, "/PGM/CPU%u/RZ/DirtyPage/Trap", "The number of traps generated for dirty bit tracking.");1862 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtyPageStale, "/PGM/CPU%u/RZ/DirtyPage/Stale", "The number of traps generated for dirty bit tracking (stale tlb entries).");1863 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtiedPage, "/PGM/CPU%u/RZ/DirtyPage/SetDirty", "The number of pages marked dirty because of write accesses.");1864 PGM_REG_COUNTER(&p PgmCpu->StatRZDirtyTrackRealPF, "/PGM/CPU%u/RZ/DirtyPage/RealPF", "The number of real pages faults during dirty bit tracking.");1865 PGM_REG_COUNTER(&p PgmCpu->StatRZPageAlreadyDirty, "/PGM/CPU%u/RZ/DirtyPage/AlreadySet", "The number of pages already marked dirty because of write accesses.");1866 PGM_REG_PROFILE(&p PgmCpu->StatRZInvalidatePage, "/PGM/CPU%u/RZ/InvalidatePage", "PGMInvalidatePage() profiling.");1867 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePage4KBPages, "/PGM/CPU%u/RZ/InvalidatePage/4KBPages", "The number of times PGMInvalidatePage() was called for a 4KB page.");1868 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePage4MBPages, "/PGM/CPU%u/RZ/InvalidatePage/4MBPages", "The number of times PGMInvalidatePage() was called for a 4MB page.");1869 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePage4MBPagesSkip, "/PGM/CPU%u/RZ/InvalidatePage/4MBPagesSkip","The number of times PGMInvalidatePage() skipped a 4MB page.");1870 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePagePDMappings, "/PGM/CPU%u/RZ/InvalidatePage/PDMappings", "The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict).");1871 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePagePDNAs, "/PGM/CPU%u/RZ/InvalidatePage/PDNAs", "The number of times PGMInvalidatePage() was called for a not accessed page directory.");1872 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePagePDNPs, "/PGM/CPU%u/RZ/InvalidatePage/PDNPs", "The number of times PGMInvalidatePage() was called for a not present page directory.");1873 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePagePDOutOfSync, "/PGM/CPU%u/RZ/InvalidatePage/PDOutOfSync", "The number of times PGMInvalidatePage() was called for an out of sync page directory.");1874 PGM_REG_COUNTER(&p PgmCpu->StatRZInvalidatePageSkipped, "/PGM/CPU%u/RZ/InvalidatePage/Skipped", "The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3.");1875 PGM_REG_COUNTER(&p PgmCpu->StatRZPageOutOfSyncSupervisor, "/PGM/CPU%u/RZ/OutOfSync/SuperVisor", "Number of traps due to pages out of sync (P) and times VerifyAccessSyncPage calls SyncPage.");1876 PGM_REG_COUNTER(&p PgmCpu->StatRZPageOutOfSyncUser, "/PGM/CPU%u/RZ/OutOfSync/User", "Number of traps due to pages out of sync (P) and times VerifyAccessSyncPage calls SyncPage.");1877 PGM_REG_COUNTER(&p PgmCpu->StatRZPageOutOfSyncSupervisorWrite,"/PGM/CPU%u/RZ/OutOfSync/SuperVisorWrite", "Number of traps due to pages out of sync (RW) and times VerifyAccessSyncPage calls SyncPage.");1878 PGM_REG_COUNTER(&p PgmCpu->StatRZPageOutOfSyncUserWrite, "/PGM/CPU%u/RZ/OutOfSync/UserWrite", "Number of traps due to pages out of sync (RW) and times VerifyAccessSyncPage calls SyncPage.");1879 PGM_REG_COUNTER(&p PgmCpu->StatRZPageOutOfSyncBallloon, "/PGM/CPU%u/RZ/OutOfSync/Balloon", "The number of times a ballooned page was accessed (read).");1880 PGM_REG_PROFILE(&p PgmCpu->StatRZPrefetch, "/PGM/CPU%u/RZ/Prefetch", "PGMPrefetchPage profiling.");1881 PGM_REG_PROFILE(&p PgmCpu->StatRZFlushTLB, "/PGM/CPU%u/RZ/FlushTLB", "Profiling of the PGMFlushTLB() body.");1882 PGM_REG_COUNTER(&p PgmCpu->StatRZFlushTLBNewCR3, "/PGM/CPU%u/RZ/FlushTLB/NewCR3", "The number of times PGMFlushTLB was called with a new CR3, non-global. (switch)");1883 PGM_REG_COUNTER(&p PgmCpu->StatRZFlushTLBNewCR3Global, "/PGM/CPU%u/RZ/FlushTLB/NewCR3Global", "The number of times PGMFlushTLB was called with a new CR3, global. (switch)");1884 PGM_REG_COUNTER(&p PgmCpu->StatRZFlushTLBSameCR3, "/PGM/CPU%u/RZ/FlushTLB/SameCR3", "The number of times PGMFlushTLB was called with the same CR3, non-global. (flush)");1885 PGM_REG_COUNTER(&p PgmCpu->StatRZFlushTLBSameCR3Global, "/PGM/CPU%u/RZ/FlushTLB/SameCR3Global", "The number of times PGMFlushTLB was called with the same CR3, global. (flush)");1886 PGM_REG_PROFILE(&p PgmCpu->StatRZGstModifyPage, "/PGM/CPU%u/RZ/GstModifyPage", "Profiling of the PGMGstModifyPage() body.");1887 1888 PGM_REG_PROFILE(&p PgmCpu->StatR3SyncCR3, "/PGM/CPU%u/R3/SyncCR3", "Profiling of the PGMSyncCR3() body.");1889 PGM_REG_PROFILE(&p PgmCpu->StatR3SyncCR3Handlers, "/PGM/CPU%u/R3/SyncCR3/Handlers", "Profiling of the PGMSyncCR3() update handler section.");1890 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3Global, "/PGM/CPU%u/R3/SyncCR3/Global", "The number of global CR3 syncs.");1891 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3NotGlobal, "/PGM/CPU%u/R3/SyncCR3/NotGlobal", "The number of non-global CR3 syncs.");1892 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3DstCacheHit, "/PGM/CPU%u/R3/SyncCR3/DstChacheHit", "The number of times we got some kind of a cache hit.");1893 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3DstFreed, "/PGM/CPU%u/R3/SyncCR3/DstFreed", "The number of times we've had to free a shadow entry.");1894 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3DstFreedSrcNP, "/PGM/CPU%u/R3/SyncCR3/DstFreedSrcNP", "The number of times we've had to free a shadow entry for which the source entry was not present.");1895 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3DstNotPresent, "/PGM/CPU%u/R3/SyncCR3/DstNotPresent", "The number of times we've encountered a not present shadow entry for a present guest entry.");1896 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3DstSkippedGlobalPD, "/PGM/CPU%u/R3/SyncCR3/DstSkippedGlobalPD", "The number of times a global page directory wasn't flushed.");1897 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncCR3DstSkippedGlobalPT, "/PGM/CPU%u/R3/SyncCR3/DstSkippedGlobalPT", "The number of times a page table with only global entries wasn't flushed.");1898 PGM_REG_PROFILE(&p PgmCpu->StatR3SyncPT, "/PGM/CPU%u/R3/SyncPT", "Profiling of the pfnSyncPT() body.");1899 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncPTFailed, "/PGM/CPU%u/R3/SyncPT/Failed", "The number of times pfnSyncPT() failed.");1900 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncPT4K, "/PGM/CPU%u/R3/SyncPT/4K", "Nr of 4K PT syncs");1901 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncPT4M, "/PGM/CPU%u/R3/SyncPT/4M", "Nr of 4M PT syncs");1902 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncPagePDNAs, "/PGM/CPU%u/R3/SyncPagePDNAs", "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit.");1903 PGM_REG_COUNTER(&p PgmCpu->StatR3SyncPagePDOutOfSync, "/PGM/CPU%u/R3/SyncPagePDOutOfSync", "The number of time we've encountered an out-of-sync PD in SyncPage.");1904 PGM_REG_COUNTER(&p PgmCpu->StatR3AccessedPage, "/PGM/CPU%u/R3/AccessedPage", "The number of pages marked not present for accessed bit emulation.");1905 PGM_REG_PROFILE(&p PgmCpu->StatR3DirtyBitTracking, "/PGM/CPU%u/R3/DirtyPage", "Profiling the dirty bit tracking in CheckPageFault().");1906 PGM_REG_COUNTER(&p PgmCpu->StatR3DirtyPage, "/PGM/CPU%u/R3/DirtyPage/Mark", "The number of pages marked read-only for dirty bit tracking.");1907 PGM_REG_COUNTER(&p PgmCpu->StatR3DirtyPageBig, "/PGM/CPU%u/R3/DirtyPage/MarkBig", "The number of 4MB pages marked read-only for dirty bit tracking.");1908 PGM_REG_COUNTER(&p PgmCpu->StatR3DirtyPageSkipped, "/PGM/CPU%u/R3/DirtyPage/Skipped", "The number of pages already dirty or readonly.");1909 PGM_REG_COUNTER(&p PgmCpu->StatR3DirtyPageTrap, "/PGM/CPU%u/R3/DirtyPage/Trap", "The number of traps generated for dirty bit tracking.");1910 PGM_REG_COUNTER(&p PgmCpu->StatR3DirtiedPage, "/PGM/CPU%u/R3/DirtyPage/SetDirty", "The number of pages marked dirty because of write accesses.");1911 PGM_REG_COUNTER(&p PgmCpu->StatR3DirtyTrackRealPF, "/PGM/CPU%u/R3/DirtyPage/RealPF", "The number of real pages faults during dirty bit tracking.");1912 PGM_REG_COUNTER(&p PgmCpu->StatR3PageAlreadyDirty, "/PGM/CPU%u/R3/DirtyPage/AlreadySet", "The number of pages already marked dirty because of write accesses.");1913 PGM_REG_PROFILE(&p PgmCpu->StatR3InvalidatePage, "/PGM/CPU%u/R3/InvalidatePage", "PGMInvalidatePage() profiling.");1914 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePage4KBPages, "/PGM/CPU%u/R3/InvalidatePage/4KBPages", "The number of times PGMInvalidatePage() was called for a 4KB page.");1915 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePage4MBPages, "/PGM/CPU%u/R3/InvalidatePage/4MBPages", "The number of times PGMInvalidatePage() was called for a 4MB page.");1916 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePage4MBPagesSkip, "/PGM/CPU%u/R3/InvalidatePage/4MBPagesSkip","The number of times PGMInvalidatePage() skipped a 4MB page.");1917 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePagePDMappings, "/PGM/CPU%u/R3/InvalidatePage/PDMappings", "The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict).");1918 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePagePDNAs, "/PGM/CPU%u/R3/InvalidatePage/PDNAs", "The number of times PGMInvalidatePage() was called for a not accessed page directory.");1919 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePagePDNPs, "/PGM/CPU%u/R3/InvalidatePage/PDNPs", "The number of times PGMInvalidatePage() was called for a not present page directory.");1920 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePagePDOutOfSync, "/PGM/CPU%u/R3/InvalidatePage/PDOutOfSync", "The number of times PGMInvalidatePage() was called for an out of sync page directory.");1921 PGM_REG_COUNTER(&p PgmCpu->StatR3InvalidatePageSkipped, "/PGM/CPU%u/R3/InvalidatePage/Skipped", "The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3.");1922 PGM_REG_COUNTER(&p PgmCpu->StatR3PageOutOfSyncSupervisor, "/PGM/CPU%u/R3/OutOfSync/SuperVisor", "Number of traps due to pages out of sync and times VerifyAccessSyncPage calls SyncPage.");1923 PGM_REG_COUNTER(&p PgmCpu->StatR3PageOutOfSyncUser, "/PGM/CPU%u/R3/OutOfSync/User", "Number of traps due to pages out of sync and times VerifyAccessSyncPage calls SyncPage.");1924 PGM_REG_COUNTER(&p PgmCpu->StatR3PageOutOfSyncBallloon, "/PGM/CPU%u/R3/OutOfSync/Balloon", "The number of times a ballooned page was accessed (read).");1925 PGM_REG_PROFILE(&p PgmCpu->StatR3Prefetch, "/PGM/CPU%u/R3/Prefetch", "PGMPrefetchPage profiling.");1926 PGM_REG_PROFILE(&p PgmCpu->StatR3FlushTLB, "/PGM/CPU%u/R3/FlushTLB", "Profiling of the PGMFlushTLB() body.");1927 PGM_REG_COUNTER(&p PgmCpu->StatR3FlushTLBNewCR3, "/PGM/CPU%u/R3/FlushTLB/NewCR3", "The number of times PGMFlushTLB was called with a new CR3, non-global. (switch)");1928 PGM_REG_COUNTER(&p PgmCpu->StatR3FlushTLBNewCR3Global, "/PGM/CPU%u/R3/FlushTLB/NewCR3Global", "The number of times PGMFlushTLB was called with a new CR3, global. (switch)");1929 PGM_REG_COUNTER(&p PgmCpu->StatR3FlushTLBSameCR3, "/PGM/CPU%u/R3/FlushTLB/SameCR3", "The number of times PGMFlushTLB was called with the same CR3, non-global. (flush)");1930 PGM_REG_COUNTER(&p PgmCpu->StatR3FlushTLBSameCR3Global, "/PGM/CPU%u/R3/FlushTLB/SameCR3Global", "The number of times PGMFlushTLB was called with the same CR3, global. (flush)");1931 PGM_REG_PROFILE(&p PgmCpu->StatR3GstModifyPage, "/PGM/CPU%u/R3/GstModifyPage", "Profiling of the PGMGstModifyPage() body.");1871 PGM_REG_PROFILE(&pCpuStats->StatRZSyncCR3, "/PGM/CPU%u/RZ/SyncCR3", "Profiling of the PGMSyncCR3() body."); 1872 PGM_REG_PROFILE(&pCpuStats->StatRZSyncCR3Handlers, "/PGM/CPU%u/RZ/SyncCR3/Handlers", "Profiling of the PGMSyncCR3() update handler section."); 1873 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3Global, "/PGM/CPU%u/RZ/SyncCR3/Global", "The number of global CR3 syncs."); 1874 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3NotGlobal, "/PGM/CPU%u/RZ/SyncCR3/NotGlobal", "The number of non-global CR3 syncs."); 1875 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3DstCacheHit, "/PGM/CPU%u/RZ/SyncCR3/DstChacheHit", "The number of times we got some kind of a cache hit."); 1876 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3DstFreed, "/PGM/CPU%u/RZ/SyncCR3/DstFreed", "The number of times we've had to free a shadow entry."); 1877 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3DstFreedSrcNP, "/PGM/CPU%u/RZ/SyncCR3/DstFreedSrcNP", "The number of times we've had to free a shadow entry for which the source entry was not present."); 1878 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3DstNotPresent, "/PGM/CPU%u/RZ/SyncCR3/DstNotPresent", "The number of times we've encountered a not present shadow entry for a present guest entry."); 1879 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3DstSkippedGlobalPD, "/PGM/CPU%u/RZ/SyncCR3/DstSkippedGlobalPD", "The number of times a global page directory wasn't flushed."); 1880 PGM_REG_COUNTER(&pCpuStats->StatRZSyncCR3DstSkippedGlobalPT, "/PGM/CPU%u/RZ/SyncCR3/DstSkippedGlobalPT", "The number of times a page table with only global entries wasn't flushed."); 1881 PGM_REG_PROFILE(&pCpuStats->StatRZSyncPT, "/PGM/CPU%u/RZ/SyncPT", "Profiling of the pfnSyncPT() body."); 1882 PGM_REG_COUNTER(&pCpuStats->StatRZSyncPTFailed, "/PGM/CPU%u/RZ/SyncPT/Failed", "The number of times pfnSyncPT() failed."); 1883 PGM_REG_COUNTER(&pCpuStats->StatRZSyncPT4K, "/PGM/CPU%u/RZ/SyncPT/4K", "Nr of 4K PT syncs"); 1884 PGM_REG_COUNTER(&pCpuStats->StatRZSyncPT4M, "/PGM/CPU%u/RZ/SyncPT/4M", "Nr of 4M PT syncs"); 1885 PGM_REG_COUNTER(&pCpuStats->StatRZSyncPagePDNAs, "/PGM/CPU%u/RZ/SyncPagePDNAs", "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit."); 1886 PGM_REG_COUNTER(&pCpuStats->StatRZSyncPagePDOutOfSync, "/PGM/CPU%u/RZ/SyncPagePDOutOfSync", "The number of time we've encountered an out-of-sync PD in SyncPage."); 1887 PGM_REG_COUNTER(&pCpuStats->StatRZAccessedPage, "/PGM/CPU%u/RZ/AccessedPage", "The number of pages marked not present for accessed bit emulation."); 1888 PGM_REG_PROFILE(&pCpuStats->StatRZDirtyBitTracking, "/PGM/CPU%u/RZ/DirtyPage", "Profiling the dirty bit tracking in CheckPageFault()."); 1889 PGM_REG_COUNTER(&pCpuStats->StatRZDirtyPage, "/PGM/CPU%u/RZ/DirtyPage/Mark", "The number of pages marked read-only for dirty bit tracking."); 1890 PGM_REG_COUNTER(&pCpuStats->StatRZDirtyPageBig, "/PGM/CPU%u/RZ/DirtyPage/MarkBig", "The number of 4MB pages marked read-only for dirty bit tracking."); 1891 PGM_REG_COUNTER(&pCpuStats->StatRZDirtyPageSkipped, "/PGM/CPU%u/RZ/DirtyPage/Skipped", "The number of pages already dirty or readonly."); 1892 PGM_REG_COUNTER(&pCpuStats->StatRZDirtyPageTrap, "/PGM/CPU%u/RZ/DirtyPage/Trap", "The number of traps generated for dirty bit tracking."); 1893 PGM_REG_COUNTER(&pCpuStats->StatRZDirtyPageStale, "/PGM/CPU%u/RZ/DirtyPage/Stale", "The number of traps generated for dirty bit tracking (stale tlb entries)."); 1894 PGM_REG_COUNTER(&pCpuStats->StatRZDirtiedPage, "/PGM/CPU%u/RZ/DirtyPage/SetDirty", "The number of pages marked dirty because of write accesses."); 1895 PGM_REG_COUNTER(&pCpuStats->StatRZDirtyTrackRealPF, "/PGM/CPU%u/RZ/DirtyPage/RealPF", "The number of real pages faults during dirty bit tracking."); 1896 PGM_REG_COUNTER(&pCpuStats->StatRZPageAlreadyDirty, "/PGM/CPU%u/RZ/DirtyPage/AlreadySet", "The number of pages already marked dirty because of write accesses."); 1897 PGM_REG_PROFILE(&pCpuStats->StatRZInvalidatePage, "/PGM/CPU%u/RZ/InvalidatePage", "PGMInvalidatePage() profiling."); 1898 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePage4KBPages, "/PGM/CPU%u/RZ/InvalidatePage/4KBPages", "The number of times PGMInvalidatePage() was called for a 4KB page."); 1899 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePage4MBPages, "/PGM/CPU%u/RZ/InvalidatePage/4MBPages", "The number of times PGMInvalidatePage() was called for a 4MB page."); 1900 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePage4MBPagesSkip, "/PGM/CPU%u/RZ/InvalidatePage/4MBPagesSkip","The number of times PGMInvalidatePage() skipped a 4MB page."); 1901 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePagePDMappings, "/PGM/CPU%u/RZ/InvalidatePage/PDMappings", "The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict)."); 1902 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePagePDNAs, "/PGM/CPU%u/RZ/InvalidatePage/PDNAs", "The number of times PGMInvalidatePage() was called for a not accessed page directory."); 1903 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePagePDNPs, "/PGM/CPU%u/RZ/InvalidatePage/PDNPs", "The number of times PGMInvalidatePage() was called for a not present page directory."); 1904 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePagePDOutOfSync, "/PGM/CPU%u/RZ/InvalidatePage/PDOutOfSync", "The number of times PGMInvalidatePage() was called for an out of sync page directory."); 1905 PGM_REG_COUNTER(&pCpuStats->StatRZInvalidatePageSkipped, "/PGM/CPU%u/RZ/InvalidatePage/Skipped", "The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3."); 1906 PGM_REG_COUNTER(&pCpuStats->StatRZPageOutOfSyncSupervisor, "/PGM/CPU%u/RZ/OutOfSync/SuperVisor", "Number of traps due to pages out of sync (P) and times VerifyAccessSyncPage calls SyncPage."); 1907 PGM_REG_COUNTER(&pCpuStats->StatRZPageOutOfSyncUser, "/PGM/CPU%u/RZ/OutOfSync/User", "Number of traps due to pages out of sync (P) and times VerifyAccessSyncPage calls SyncPage."); 1908 PGM_REG_COUNTER(&pCpuStats->StatRZPageOutOfSyncSupervisorWrite,"/PGM/CPU%u/RZ/OutOfSync/SuperVisorWrite", "Number of traps due to pages out of sync (RW) and times VerifyAccessSyncPage calls SyncPage."); 1909 PGM_REG_COUNTER(&pCpuStats->StatRZPageOutOfSyncUserWrite, "/PGM/CPU%u/RZ/OutOfSync/UserWrite", "Number of traps due to pages out of sync (RW) and times VerifyAccessSyncPage calls SyncPage."); 1910 PGM_REG_COUNTER(&pCpuStats->StatRZPageOutOfSyncBallloon, "/PGM/CPU%u/RZ/OutOfSync/Balloon", "The number of times a ballooned page was accessed (read)."); 1911 PGM_REG_PROFILE(&pCpuStats->StatRZPrefetch, "/PGM/CPU%u/RZ/Prefetch", "PGMPrefetchPage profiling."); 1912 PGM_REG_PROFILE(&pCpuStats->StatRZFlushTLB, "/PGM/CPU%u/RZ/FlushTLB", "Profiling of the PGMFlushTLB() body."); 1913 PGM_REG_COUNTER(&pCpuStats->StatRZFlushTLBNewCR3, "/PGM/CPU%u/RZ/FlushTLB/NewCR3", "The number of times PGMFlushTLB was called with a new CR3, non-global. (switch)"); 1914 PGM_REG_COUNTER(&pCpuStats->StatRZFlushTLBNewCR3Global, "/PGM/CPU%u/RZ/FlushTLB/NewCR3Global", "The number of times PGMFlushTLB was called with a new CR3, global. (switch)"); 1915 PGM_REG_COUNTER(&pCpuStats->StatRZFlushTLBSameCR3, "/PGM/CPU%u/RZ/FlushTLB/SameCR3", "The number of times PGMFlushTLB was called with the same CR3, non-global. (flush)"); 1916 PGM_REG_COUNTER(&pCpuStats->StatRZFlushTLBSameCR3Global, "/PGM/CPU%u/RZ/FlushTLB/SameCR3Global", "The number of times PGMFlushTLB was called with the same CR3, global. (flush)"); 1917 PGM_REG_PROFILE(&pCpuStats->StatRZGstModifyPage, "/PGM/CPU%u/RZ/GstModifyPage", "Profiling of the PGMGstModifyPage() body."); 1918 1919 PGM_REG_PROFILE(&pCpuStats->StatR3SyncCR3, "/PGM/CPU%u/R3/SyncCR3", "Profiling of the PGMSyncCR3() body."); 1920 PGM_REG_PROFILE(&pCpuStats->StatR3SyncCR3Handlers, "/PGM/CPU%u/R3/SyncCR3/Handlers", "Profiling of the PGMSyncCR3() update handler section."); 1921 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3Global, "/PGM/CPU%u/R3/SyncCR3/Global", "The number of global CR3 syncs."); 1922 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3NotGlobal, "/PGM/CPU%u/R3/SyncCR3/NotGlobal", "The number of non-global CR3 syncs."); 1923 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3DstCacheHit, "/PGM/CPU%u/R3/SyncCR3/DstChacheHit", "The number of times we got some kind of a cache hit."); 1924 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3DstFreed, "/PGM/CPU%u/R3/SyncCR3/DstFreed", "The number of times we've had to free a shadow entry."); 1925 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3DstFreedSrcNP, "/PGM/CPU%u/R3/SyncCR3/DstFreedSrcNP", "The number of times we've had to free a shadow entry for which the source entry was not present."); 1926 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3DstNotPresent, "/PGM/CPU%u/R3/SyncCR3/DstNotPresent", "The number of times we've encountered a not present shadow entry for a present guest entry."); 1927 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3DstSkippedGlobalPD, "/PGM/CPU%u/R3/SyncCR3/DstSkippedGlobalPD", "The number of times a global page directory wasn't flushed."); 1928 PGM_REG_COUNTER(&pCpuStats->StatR3SyncCR3DstSkippedGlobalPT, "/PGM/CPU%u/R3/SyncCR3/DstSkippedGlobalPT", "The number of times a page table with only global entries wasn't flushed."); 1929 PGM_REG_PROFILE(&pCpuStats->StatR3SyncPT, "/PGM/CPU%u/R3/SyncPT", "Profiling of the pfnSyncPT() body."); 1930 PGM_REG_COUNTER(&pCpuStats->StatR3SyncPTFailed, "/PGM/CPU%u/R3/SyncPT/Failed", "The number of times pfnSyncPT() failed."); 1931 PGM_REG_COUNTER(&pCpuStats->StatR3SyncPT4K, "/PGM/CPU%u/R3/SyncPT/4K", "Nr of 4K PT syncs"); 1932 PGM_REG_COUNTER(&pCpuStats->StatR3SyncPT4M, "/PGM/CPU%u/R3/SyncPT/4M", "Nr of 4M PT syncs"); 1933 PGM_REG_COUNTER(&pCpuStats->StatR3SyncPagePDNAs, "/PGM/CPU%u/R3/SyncPagePDNAs", "The number of time we've marked a PD not present from SyncPage to virtualize the accessed bit."); 1934 PGM_REG_COUNTER(&pCpuStats->StatR3SyncPagePDOutOfSync, "/PGM/CPU%u/R3/SyncPagePDOutOfSync", "The number of time we've encountered an out-of-sync PD in SyncPage."); 1935 PGM_REG_COUNTER(&pCpuStats->StatR3AccessedPage, "/PGM/CPU%u/R3/AccessedPage", "The number of pages marked not present for accessed bit emulation."); 1936 PGM_REG_PROFILE(&pCpuStats->StatR3DirtyBitTracking, "/PGM/CPU%u/R3/DirtyPage", "Profiling the dirty bit tracking in CheckPageFault()."); 1937 PGM_REG_COUNTER(&pCpuStats->StatR3DirtyPage, "/PGM/CPU%u/R3/DirtyPage/Mark", "The number of pages marked read-only for dirty bit tracking."); 1938 PGM_REG_COUNTER(&pCpuStats->StatR3DirtyPageBig, "/PGM/CPU%u/R3/DirtyPage/MarkBig", "The number of 4MB pages marked read-only for dirty bit tracking."); 1939 PGM_REG_COUNTER(&pCpuStats->StatR3DirtyPageSkipped, "/PGM/CPU%u/R3/DirtyPage/Skipped", "The number of pages already dirty or readonly."); 1940 PGM_REG_COUNTER(&pCpuStats->StatR3DirtyPageTrap, "/PGM/CPU%u/R3/DirtyPage/Trap", "The number of traps generated for dirty bit tracking."); 1941 PGM_REG_COUNTER(&pCpuStats->StatR3DirtiedPage, "/PGM/CPU%u/R3/DirtyPage/SetDirty", "The number of pages marked dirty because of write accesses."); 1942 PGM_REG_COUNTER(&pCpuStats->StatR3DirtyTrackRealPF, "/PGM/CPU%u/R3/DirtyPage/RealPF", "The number of real pages faults during dirty bit tracking."); 1943 PGM_REG_COUNTER(&pCpuStats->StatR3PageAlreadyDirty, "/PGM/CPU%u/R3/DirtyPage/AlreadySet", "The number of pages already marked dirty because of write accesses."); 1944 PGM_REG_PROFILE(&pCpuStats->StatR3InvalidatePage, "/PGM/CPU%u/R3/InvalidatePage", "PGMInvalidatePage() profiling."); 1945 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePage4KBPages, "/PGM/CPU%u/R3/InvalidatePage/4KBPages", "The number of times PGMInvalidatePage() was called for a 4KB page."); 1946 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePage4MBPages, "/PGM/CPU%u/R3/InvalidatePage/4MBPages", "The number of times PGMInvalidatePage() was called for a 4MB page."); 1947 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePage4MBPagesSkip, "/PGM/CPU%u/R3/InvalidatePage/4MBPagesSkip","The number of times PGMInvalidatePage() skipped a 4MB page."); 1948 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePagePDMappings, "/PGM/CPU%u/R3/InvalidatePage/PDMappings", "The number of times PGMInvalidatePage() was called for a page directory containing mappings (no conflict)."); 1949 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePagePDNAs, "/PGM/CPU%u/R3/InvalidatePage/PDNAs", "The number of times PGMInvalidatePage() was called for a not accessed page directory."); 1950 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePagePDNPs, "/PGM/CPU%u/R3/InvalidatePage/PDNPs", "The number of times PGMInvalidatePage() was called for a not present page directory."); 1951 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePagePDOutOfSync, "/PGM/CPU%u/R3/InvalidatePage/PDOutOfSync", "The number of times PGMInvalidatePage() was called for an out of sync page directory."); 1952 PGM_REG_COUNTER(&pCpuStats->StatR3InvalidatePageSkipped, "/PGM/CPU%u/R3/InvalidatePage/Skipped", "The number of times PGMInvalidatePage() was skipped due to not present shw or pending pending SyncCR3."); 1953 PGM_REG_COUNTER(&pCpuStats->StatR3PageOutOfSyncSupervisor, "/PGM/CPU%u/R3/OutOfSync/SuperVisor", "Number of traps due to pages out of sync and times VerifyAccessSyncPage calls SyncPage."); 1954 PGM_REG_COUNTER(&pCpuStats->StatR3PageOutOfSyncUser, "/PGM/CPU%u/R3/OutOfSync/User", "Number of traps due to pages out of sync and times VerifyAccessSyncPage calls SyncPage."); 1955 PGM_REG_COUNTER(&pCpuStats->StatR3PageOutOfSyncBallloon, "/PGM/CPU%u/R3/OutOfSync/Balloon", "The number of times a ballooned page was accessed (read)."); 1956 PGM_REG_PROFILE(&pCpuStats->StatR3Prefetch, "/PGM/CPU%u/R3/Prefetch", "PGMPrefetchPage profiling."); 1957 PGM_REG_PROFILE(&pCpuStats->StatR3FlushTLB, "/PGM/CPU%u/R3/FlushTLB", "Profiling of the PGMFlushTLB() body."); 1958 PGM_REG_COUNTER(&pCpuStats->StatR3FlushTLBNewCR3, "/PGM/CPU%u/R3/FlushTLB/NewCR3", "The number of times PGMFlushTLB was called with a new CR3, non-global. (switch)"); 1959 PGM_REG_COUNTER(&pCpuStats->StatR3FlushTLBNewCR3Global, "/PGM/CPU%u/R3/FlushTLB/NewCR3Global", "The number of times PGMFlushTLB was called with a new CR3, global. (switch)"); 1960 PGM_REG_COUNTER(&pCpuStats->StatR3FlushTLBSameCR3, "/PGM/CPU%u/R3/FlushTLB/SameCR3", "The number of times PGMFlushTLB was called with the same CR3, non-global. (flush)"); 1961 PGM_REG_COUNTER(&pCpuStats->StatR3FlushTLBSameCR3Global, "/PGM/CPU%u/R3/FlushTLB/SameCR3Global", "The number of times PGMFlushTLB was called with the same CR3, global. (flush)"); 1962 PGM_REG_PROFILE(&pCpuStats->StatR3GstModifyPage, "/PGM/CPU%u/R3/GstModifyPage", "Profiling of the PGMGstModifyPage() body."); 1932 1963 #endif /* VBOX_WITH_STATISTICS */ 1933 1964 … … 1936 1967 1937 1968 } 1969 1970 return VINF_SUCCESS; 1938 1971 } 1939 1972 … … 2193 2226 */ 2194 2227 pgmR3PoolRelocate(pVM); 2228 2229 #ifdef VBOX_WITH_STATISTICS 2230 /* 2231 * Statistics. 2232 */ 2233 pVM->pgm.s.pStatsRC = MMHyperCCToRC(pVM, pVM->pgm.s.pStatsR3); 2234 for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++) 2235 pVM->aCpus[iCpu].pgm.s.pStatsRC = MMHyperCCToRC(pVM, pVM->aCpus[iCpu].pgm.s.pStatsR3); 2236 #endif 2195 2237 } 2196 2238 -
trunk/src/VBox/VMM/PGMInline.h
r31080 r31123 513 513 if (pTlbe->GCPhys == (GCPhys & X86_PTE_PAE_PG_MASK)) 514 514 { 515 STAM_COUNTER_INC(&pPGM->CTX_ MID_Z(Stat,PageMapTlbHits));515 STAM_COUNTER_INC(&pPGM->CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageMapTlbHits)); 516 516 rc = VINF_SUCCESS; 517 517 } … … 543 543 if (pTlbe->GCPhys == (GCPhys & X86_PTE_PAE_PG_MASK)) 544 544 { 545 STAM_COUNTER_INC(&pPGM->CTX_ MID_Z(Stat,PageMapTlbHits));545 STAM_COUNTER_INC(&pPGM->CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageMapTlbHits)); 546 546 rc = VINF_SUCCESS; 547 547 } -
trunk/src/VBox/VMM/PGMInternal.h
r31102 r31123 2608 2608 2609 2609 2610 #ifdef VBOX_WITH_STATISTICS 2611 /** 2612 * PGM statistics. 2613 * 2614 * These lives on the heap when compiled in as they would otherwise waste 2615 * unecessary space in release builds. 2616 */ 2617 typedef struct PGMSTATS 2618 { 2619 /* R3 only: */ 2620 STAMCOUNTER StatR3DetectedConflicts; /**< R3: Number of times PGMR3MapHasConflicts() detected a conflict. */ 2621 STAMPROFILE StatR3ResolveConflict; /**< R3: pgmR3SyncPTResolveConflict() profiling (includes the entire relocation). */ 2622 2623 STAMCOUNTER StatRZChunkR3MapTlbHits; /**< RC/R0: Ring-3/0 chunk mapper TLB hits. */ 2624 STAMCOUNTER StatRZChunkR3MapTlbMisses; /**< RC/R0: Ring-3/0 chunk mapper TLB misses. */ 2625 STAMCOUNTER StatRZPageMapTlbHits; /**< RC/R0: Ring-3/0 page mapper TLB hits. */ 2626 STAMCOUNTER StatRZPageMapTlbMisses; /**< RC/R0: Ring-3/0 page mapper TLB misses. */ 2627 STAMCOUNTER StatPageMapTlbFlushes; /**< ALL: Ring-3/0 page mapper TLB flushes. */ 2628 STAMCOUNTER StatPageMapTlbFlushEntry; /**< ALL: Ring-3/0 page mapper TLB flushes. */ 2629 STAMCOUNTER StatR3ChunkR3MapTlbHits; /**< R3: Ring-3/0 chunk mapper TLB hits. */ 2630 STAMCOUNTER StatR3ChunkR3MapTlbMisses; /**< R3: Ring-3/0 chunk mapper TLB misses. */ 2631 STAMCOUNTER StatR3PageMapTlbHits; /**< R3: Ring-3/0 page mapper TLB hits. */ 2632 STAMCOUNTER StatR3PageMapTlbMisses; /**< R3: Ring-3/0 page mapper TLB misses. */ 2633 STAMPROFILE StatRZSyncCR3HandlerVirtualReset; /**< RC/R0: Profiling of the virtual handler resets. */ 2634 STAMPROFILE StatRZSyncCR3HandlerVirtualUpdate; /**< RC/R0: Profiling of the virtual handler updates. */ 2635 STAMPROFILE StatR3SyncCR3HandlerVirtualReset; /**< R3: Profiling of the virtual handler resets. */ 2636 STAMPROFILE StatR3SyncCR3HandlerVirtualUpdate; /**< R3: Profiling of the virtual handler updates. */ 2637 STAMCOUNTER StatR3PhysHandlerReset; /**< R3: The number of times PGMHandlerPhysicalReset is called. */ 2638 STAMCOUNTER StatRZPhysHandlerReset; /**< RC/R0: The number of times PGMHandlerPhysicalReset is called. */ 2639 STAMPROFILE StatRZVirtHandlerSearchByPhys; /**< RC/R0: Profiling of pgmHandlerVirtualFindByPhysAddr. */ 2640 STAMPROFILE StatR3VirtHandlerSearchByPhys; /**< R3: Profiling of pgmHandlerVirtualFindByPhysAddr. */ 2641 STAMCOUNTER StatRZPageReplaceShared; /**< RC/R0: Times a shared page has been replaced by a private one. */ 2642 STAMCOUNTER StatRZPageReplaceZero; /**< RC/R0: Times the zero page has been replaced by a private one. */ 2643 /// @todo STAMCOUNTER StatRZPageHandyAllocs; /**< RC/R0: The number of times we've executed GMMR3AllocateHandyPages. */ 2644 STAMCOUNTER StatR3PageReplaceShared; /**< R3: Times a shared page has been replaced by a private one. */ 2645 STAMCOUNTER StatR3PageReplaceZero; /**< R3: Times the zero page has been replaced by a private one. */ 2646 /// @todo STAMCOUNTER StatR3PageHandyAllocs; /**< R3: The number of times we've executed GMMR3AllocateHandyPages. */ 2647 2648 /* RC only: */ 2649 STAMCOUNTER StatRCDynMapCacheMisses; /**< RC: The number of dynamic page mapping cache misses */ 2650 STAMCOUNTER StatRCDynMapCacheHits; /**< RC: The number of dynamic page mapping cache hits */ 2651 STAMCOUNTER StatRCInvlPgConflict; /**< RC: Number of times PGMInvalidatePage() detected a mapping conflict. */ 2652 STAMCOUNTER StatRCInvlPgSyncMonCR3; /**< RC: Number of times PGMInvalidatePage() ran into PGM_SYNC_MONITOR_CR3. */ 2653 2654 STAMCOUNTER StatRZPhysRead; 2655 STAMCOUNTER StatRZPhysReadBytes; 2656 STAMCOUNTER StatRZPhysWrite; 2657 STAMCOUNTER StatRZPhysWriteBytes; 2658 STAMCOUNTER StatR3PhysRead; 2659 STAMCOUNTER StatR3PhysReadBytes; 2660 STAMCOUNTER StatR3PhysWrite; 2661 STAMCOUNTER StatR3PhysWriteBytes; 2662 STAMCOUNTER StatRCPhysRead; 2663 STAMCOUNTER StatRCPhysReadBytes; 2664 STAMCOUNTER StatRCPhysWrite; 2665 STAMCOUNTER StatRCPhysWriteBytes; 2666 2667 STAMCOUNTER StatRZPhysSimpleRead; 2668 STAMCOUNTER StatRZPhysSimpleReadBytes; 2669 STAMCOUNTER StatRZPhysSimpleWrite; 2670 STAMCOUNTER StatRZPhysSimpleWriteBytes; 2671 STAMCOUNTER StatR3PhysSimpleRead; 2672 STAMCOUNTER StatR3PhysSimpleReadBytes; 2673 STAMCOUNTER StatR3PhysSimpleWrite; 2674 STAMCOUNTER StatR3PhysSimpleWriteBytes; 2675 STAMCOUNTER StatRCPhysSimpleRead; 2676 STAMCOUNTER StatRCPhysSimpleReadBytes; 2677 STAMCOUNTER StatRCPhysSimpleWrite; 2678 STAMCOUNTER StatRCPhysSimpleWriteBytes; 2679 2680 STAMCOUNTER StatTrackVirgin; /**< The number of first time shadowings. */ 2681 STAMCOUNTER StatTrackAliased; /**< The number of times switching to cRef2, i.e. the page is being shadowed by two PTs. */ 2682 STAMCOUNTER StatTrackAliasedMany; /**< The number of times we're tracking using cRef2. */ 2683 STAMCOUNTER StatTrackAliasedLots; /**< The number of times we're hitting pages which has overflowed cRef2. */ 2684 STAMCOUNTER StatTrackNoExtentsLeft; /**< The number of times the extent list was exhausted. */ 2685 STAMCOUNTER StatTrackOverflows; /**< The number of times the extent list grows to long. */ 2686 STAMPROFILE StatTrackDeref; /**< Profiling of SyncPageWorkerTrackDeref (expensive). */ 2687 2688 /** Time spent by the host OS for large page allocation. */ 2689 STAMPROFILE StatAllocLargePage; 2690 /** Time spent clearing the newly allocated large pages. */ 2691 STAMPROFILE StatClearLargePage; 2692 /** pgmPhysIsValidLargePage profiling - R3 */ 2693 STAMPROFILE StatR3IsValidLargePage; 2694 /** pgmPhysIsValidLargePage profiling - RZ*/ 2695 STAMPROFILE StatRZIsValidLargePage; 2696 2697 STAMPROFILE StatChunkAging; 2698 STAMPROFILE StatChunkFindCandidate; 2699 STAMPROFILE StatChunkUnmap; 2700 STAMPROFILE StatChunkMap; 2701 } PGMSTATS; 2702 #endif /* VBOX_WITH_STATISTICS */ 2703 2610 2704 2611 2705 /** … … 2970 3064 /** @} */ 2971 3065 2972 #ifdef VBOX_WITH_STATISTICS /** @todo move this chunk to the heap. */ 2973 /* R3 only: */ 2974 STAMCOUNTER StatR3DetectedConflicts; /**< R3: Number of times PGMR3MapHasConflicts() detected a conflict. */ 2975 STAMPROFILE StatR3ResolveConflict; /**< R3: pgmR3SyncPTResolveConflict() profiling (includes the entire relocation). */ 2976 2977 STAMCOUNTER StatRZChunkR3MapTlbHits; /**< RC/R0: Ring-3/0 chunk mapper TLB hits. */ 2978 STAMCOUNTER StatRZChunkR3MapTlbMisses; /**< RC/R0: Ring-3/0 chunk mapper TLB misses. */ 2979 STAMCOUNTER StatRZPageMapTlbHits; /**< RC/R0: Ring-3/0 page mapper TLB hits. */ 2980 STAMCOUNTER StatRZPageMapTlbMisses; /**< RC/R0: Ring-3/0 page mapper TLB misses. */ 2981 STAMCOUNTER StatPageMapTlbFlushes; /**< ALL: Ring-3/0 page mapper TLB flushes. */ 2982 STAMCOUNTER StatPageMapTlbFlushEntry; /**< ALL: Ring-3/0 page mapper TLB flushes. */ 2983 STAMCOUNTER StatR3ChunkR3MapTlbHits; /**< R3: Ring-3/0 chunk mapper TLB hits. */ 2984 STAMCOUNTER StatR3ChunkR3MapTlbMisses; /**< R3: Ring-3/0 chunk mapper TLB misses. */ 2985 STAMCOUNTER StatR3PageMapTlbHits; /**< R3: Ring-3/0 page mapper TLB hits. */ 2986 STAMCOUNTER StatR3PageMapTlbMisses; /**< R3: Ring-3/0 page mapper TLB misses. */ 2987 STAMPROFILE StatRZSyncCR3HandlerVirtualReset; /**< RC/R0: Profiling of the virtual handler resets. */ 2988 STAMPROFILE StatRZSyncCR3HandlerVirtualUpdate; /**< RC/R0: Profiling of the virtual handler updates. */ 2989 STAMPROFILE StatR3SyncCR3HandlerVirtualReset; /**< R3: Profiling of the virtual handler resets. */ 2990 STAMPROFILE StatR3SyncCR3HandlerVirtualUpdate; /**< R3: Profiling of the virtual handler updates. */ 2991 STAMCOUNTER StatR3PhysHandlerReset; /**< R3: The number of times PGMHandlerPhysicalReset is called. */ 2992 STAMCOUNTER StatRZPhysHandlerReset; /**< RC/R0: The number of times PGMHandlerPhysicalReset is called. */ 2993 STAMPROFILE StatRZVirtHandlerSearchByPhys; /**< RC/R0: Profiling of pgmHandlerVirtualFindByPhysAddr. */ 2994 STAMPROFILE StatR3VirtHandlerSearchByPhys; /**< R3: Profiling of pgmHandlerVirtualFindByPhysAddr. */ 2995 STAMCOUNTER StatRZPageReplaceShared; /**< RC/R0: Times a shared page has been replaced by a private one. */ 2996 STAMCOUNTER StatRZPageReplaceZero; /**< RC/R0: Times the zero page has been replaced by a private one. */ 2997 /// @todo STAMCOUNTER StatRZPageHandyAllocs; /**< RC/R0: The number of times we've executed GMMR3AllocateHandyPages. */ 2998 STAMCOUNTER StatR3PageReplaceShared; /**< R3: Times a shared page has been replaced by a private one. */ 2999 STAMCOUNTER StatR3PageReplaceZero; /**< R3: Times the zero page has been replaced by a private one. */ 3000 /// @todo STAMCOUNTER StatR3PageHandyAllocs; /**< R3: The number of times we've executed GMMR3AllocateHandyPages. */ 3001 3002 /* RC only: */ 3003 STAMCOUNTER StatRCDynMapCacheMisses; /**< RC: The number of dynamic page mapping cache misses */ 3004 STAMCOUNTER StatRCDynMapCacheHits; /**< RC: The number of dynamic page mapping cache hits */ 3005 STAMCOUNTER StatRCInvlPgConflict; /**< RC: Number of times PGMInvalidatePage() detected a mapping conflict. */ 3006 STAMCOUNTER StatRCInvlPgSyncMonCR3; /**< RC: Number of times PGMInvalidatePage() ran into PGM_SYNC_MONITOR_CR3. */ 3007 3008 STAMCOUNTER StatRZPhysRead; 3009 STAMCOUNTER StatRZPhysReadBytes; 3010 STAMCOUNTER StatRZPhysWrite; 3011 STAMCOUNTER StatRZPhysWriteBytes; 3012 STAMCOUNTER StatR3PhysRead; 3013 STAMCOUNTER StatR3PhysReadBytes; 3014 STAMCOUNTER StatR3PhysWrite; 3015 STAMCOUNTER StatR3PhysWriteBytes; 3016 STAMCOUNTER StatRCPhysRead; 3017 STAMCOUNTER StatRCPhysReadBytes; 3018 STAMCOUNTER StatRCPhysWrite; 3019 STAMCOUNTER StatRCPhysWriteBytes; 3020 3021 STAMCOUNTER StatRZPhysSimpleRead; 3022 STAMCOUNTER StatRZPhysSimpleReadBytes; 3023 STAMCOUNTER StatRZPhysSimpleWrite; 3024 STAMCOUNTER StatRZPhysSimpleWriteBytes; 3025 STAMCOUNTER StatR3PhysSimpleRead; 3026 STAMCOUNTER StatR3PhysSimpleReadBytes; 3027 STAMCOUNTER StatR3PhysSimpleWrite; 3028 STAMCOUNTER StatR3PhysSimpleWriteBytes; 3029 STAMCOUNTER StatRCPhysSimpleRead; 3030 STAMCOUNTER StatRCPhysSimpleReadBytes; 3031 STAMCOUNTER StatRCPhysSimpleWrite; 3032 STAMCOUNTER StatRCPhysSimpleWriteBytes; 3033 3034 STAMCOUNTER StatTrackVirgin; /**< The number of first time shadowings. */ 3035 STAMCOUNTER StatTrackAliased; /**< The number of times switching to cRef2, i.e. the page is being shadowed by two PTs. */ 3036 STAMCOUNTER StatTrackAliasedMany; /**< The number of times we're tracking using cRef2. */ 3037 STAMCOUNTER StatTrackAliasedLots; /**< The number of times we're hitting pages which has overflowed cRef2. */ 3038 STAMCOUNTER StatTrackNoExtentsLeft; /**< The number of times the extent list was exhausted. */ 3039 STAMCOUNTER StatTrackOverflows; /**< The number of times the extent list grows to long. */ 3040 STAMPROFILE StatTrackDeref; /**< Profiling of SyncPageWorkerTrackDeref (expensive). */ 3041 3042 /** Time spent by the host OS for large page allocation. */ 3043 STAMPROFILE StatAllocLargePage; 3044 /** Time spent clearing the newly allocated large pages. */ 3045 STAMPROFILE StatClearLargePage; 3046 /** pgmPhysIsValidLargePage profiling - R3 */ 3047 STAMPROFILE StatR3IsValidLargePage; 3048 /** pgmPhysIsValidLargePage profiling - RZ*/ 3049 STAMPROFILE StatRZIsValidLargePage; 3050 3051 STAMPROFILE StatChunkAging; 3052 STAMPROFILE StatChunkFindCandidate; 3053 STAMPROFILE StatChunkUnmap; 3054 STAMPROFILE StatChunkMap; 3066 #ifdef VBOX_WITH_STATISTICS 3067 /** @name Statistics on the heap. 3068 * @{ */ 3069 R3PTRTYPE(PGMSTATS *) pStatsR3; 3070 R0PTRTYPE(PGMSTATS *) pStatsR0; 3071 RCPTRTYPE(PGMSTATS *) pStatsRC; 3072 RTRCPTR RCPtrAlignment; 3073 /** @} */ 3055 3074 #endif 3056 3075 } PGM; … … 3071 3090 3072 3091 3073 /** 3074 * Converts a PGMCPU pointer into a VM pointer. 3075 * @returns Pointer to the VM structure the PGM is part of. 3076 * @param pPGM Pointer to PGMCPU instance data. 3077 */ 3078 #define PGMCPU2VM(pPGM) ( (PVM)((char*)(pPGM) - (pPGM)->offVM) ) 3079 3080 /** 3081 * Converts a PGMCPU pointer into a PGM pointer. 3082 * @returns Pointer to the VM structure the PGM is part of. 3083 * @param pPGM Pointer to PGMCPU instance data. 3084 */ 3085 #define PGMCPU2PGM(pPGMCpu) ( (PPGM)((char *)(pPGMCpu) - (pPGMCpu)->offPGM) ) 3086 3087 /** 3088 * PGMCPU Data (part of VMCPU). 3089 */ 3090 typedef struct PGMCPU 3091 { 3092 /** Offset to the VM structure. */ 3093 RTINT offVM; 3094 /** Offset to the VMCPU structure. */ 3095 RTINT offVCpu; 3096 /** Offset of the PGM structure relative to VMCPU. */ 3097 RTINT offPGM; 3098 RTINT uPadding0; /**< structure size alignment. */ 3099 3100 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 3101 /** Automatically tracked physical memory mapping set. 3102 * Ring-0 and strict raw-mode builds. */ 3103 PGMMAPSET AutoSet; 3104 #endif 3105 3106 /** A20 gate mask. 3107 * Our current approach to A20 emulation is to let REM do it and don't bother 3108 * anywhere else. The interesting Guests will be operating with it enabled anyway. 3109 * But whould need arrise, we'll subject physical addresses to this mask. */ 3110 RTGCPHYS GCPhysA20Mask; 3111 /** A20 gate state - boolean! */ 3112 bool fA20Enabled; 3113 /** Mirror of the EFER.NXE bit. Managed by PGMNotifyNxeChanged. */ 3114 bool fNoExecuteEnabled; 3115 /** Unused bits. */ 3116 bool afUnused[2]; 3117 3118 /** What needs syncing (PGM_SYNC_*). 3119 * This is used to queue operations for PGMSyncCR3, PGMInvalidatePage, 3120 * PGMFlushTLB, and PGMR3Load. */ 3121 RTUINT fSyncFlags; 3122 3123 /** The shadow paging mode. */ 3124 PGMMODE enmShadowMode; 3125 /** The guest paging mode. */ 3126 PGMMODE enmGuestMode; 3127 3128 /** The current physical address representing in the guest CR3 register. */ 3129 RTGCPHYS GCPhysCR3; 3130 3131 /** @name 32-bit Guest Paging. 3132 * @{ */ 3133 /** The guest's page directory, R3 pointer. */ 3134 R3PTRTYPE(PX86PD) pGst32BitPdR3; 3135 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3136 /** The guest's page directory, R0 pointer. */ 3137 R0PTRTYPE(PX86PD) pGst32BitPdR0; 3138 #endif 3139 /** The guest's page directory, static RC mapping. */ 3140 RCPTRTYPE(PX86PD) pGst32BitPdRC; 3141 /** Mask containing the MBZ bits of a big page PDE. */ 3142 uint32_t fGst32BitMbzBigPdeMask; 3143 /** Set if the page size extension (PSE) is enabled. */ 3144 bool fGst32BitPageSizeExtension; 3145 /** Alignment padding. */ 3146 bool afAlignment4[3]; 3147 /** @} */ 3148 3149 /** @name PAE Guest Paging. 3150 * @{ */ 3151 /** The guest's page directory pointer table, static RC mapping. */ 3152 RCPTRTYPE(PX86PDPT) pGstPaePdptRC; 3153 /** The guest's page directory pointer table, R3 pointer. */ 3154 R3PTRTYPE(PX86PDPT) pGstPaePdptR3; 3155 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3156 /** The guest's page directory pointer table, R0 pointer. */ 3157 R0PTRTYPE(PX86PDPT) pGstPaePdptR0; 3158 #endif 3159 3160 /** The guest's page directories, R3 pointers. 3161 * These are individual pointers and don't have to be adjecent. 3162 * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */ 3163 R3PTRTYPE(PX86PDPAE) apGstPaePDsR3[4]; 3164 /** The guest's page directories, R0 pointers. 3165 * Same restrictions as apGstPaePDsR3. */ 3166 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3167 R0PTRTYPE(PX86PDPAE) apGstPaePDsR0[4]; 3168 #endif 3169 /** The guest's page directories, static GC mapping. 3170 * Unlike the R3/R0 array the first entry can be accessed as a 2048 entry PD. 3171 * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */ 3172 RCPTRTYPE(PX86PDPAE) apGstPaePDsRC[4]; 3173 /** The physical addresses of the guest page directories (PAE) pointed to by apGstPagePDsHC/GC. */ 3174 RTGCPHYS aGCPhysGstPaePDs[4]; 3175 /** The physical addresses of the monitored guest page directories (PAE). */ 3176 RTGCPHYS aGCPhysGstPaePDsMonitored[4]; 3177 /** Mask containing the MBZ PTE bits. */ 3178 uint64_t fGstPaeMbzPteMask; 3179 /** Mask containing the MBZ PDE bits. */ 3180 uint64_t fGstPaeMbzPdeMask; 3181 /** Mask containing the MBZ big page PDE bits. */ 3182 uint64_t fGstPaeMbzBigPdeMask; 3183 /** Mask containing the MBZ PDPE bits. */ 3184 uint64_t fGstPaeMbzPdpeMask; 3185 /** @} */ 3186 3187 /** @name AMD64 Guest Paging. 3188 * @{ */ 3189 /** The guest's page directory pointer table, R3 pointer. */ 3190 R3PTRTYPE(PX86PML4) pGstAmd64Pml4R3; 3191 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3192 /** The guest's page directory pointer table, R0 pointer. */ 3193 R0PTRTYPE(PX86PML4) pGstAmd64Pml4R0; 3194 #else 3195 RTR0PTR alignment6b; /**< alignment equalizer. */ 3196 #endif 3197 /** Mask containing the MBZ PTE bits. */ 3198 uint64_t fGstAmd64MbzPteMask; 3199 /** Mask containing the MBZ PDE bits. */ 3200 uint64_t fGstAmd64MbzPdeMask; 3201 /** Mask containing the MBZ big page PDE bits. */ 3202 uint64_t fGstAmd64MbzBigPdeMask; 3203 /** Mask containing the MBZ PDPE bits. */ 3204 uint64_t fGstAmd64MbzPdpeMask; 3205 /** Mask containing the MBZ big page PDPE bits. */ 3206 uint64_t fGstAmd64MbzBigPdpeMask; 3207 /** Mask containing the MBZ PML4E bits. */ 3208 uint64_t fGstAmd64MbzPml4eMask; 3209 /** @} */ 3210 3211 /** Pointer to the page of the current active CR3 - R3 Ptr. */ 3212 R3PTRTYPE(PPGMPOOLPAGE) pShwPageCR3R3; 3213 /** Pointer to the page of the current active CR3 - R0 Ptr. */ 3214 R0PTRTYPE(PPGMPOOLPAGE) pShwPageCR3R0; 3215 /** Pointer to the page of the current active CR3 - RC Ptr. */ 3216 RCPTRTYPE(PPGMPOOLPAGE) pShwPageCR3RC; 3217 /* The shadow page pool index of the user table as specified during allocation; useful for freeing root pages */ 3218 uint32_t iShwUser; 3219 /* The index into the user table (shadowed) as specified during allocation; useful for freeing root pages. */ 3220 uint32_t iShwUserTable; 3221 # if HC_ARCH_BITS == 64 3222 RTRCPTR alignment6; /**< structure size alignment. */ 3223 # endif 3224 /** @} */ 3225 3226 /** @name Function pointers for Shadow paging. 3227 * @{ 3228 */ 3229 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 3230 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVMCPU pVCpu)); 3231 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 3232 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)); 3233 3234 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 3235 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)); 3236 3237 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 3238 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)); 3239 3240 /** @} */ 3241 3242 /** @name Function pointers for Guest paging. 3243 * @{ 3244 */ 3245 DECLR3CALLBACKMEMBER(int, pfnR3GstRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 3246 DECLR3CALLBACKMEMBER(int, pfnR3GstExit,(PVMCPU pVCpu)); 3247 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 3248 DECLR3CALLBACKMEMBER(int, pfnR3GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 3249 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 3250 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 3251 DECLRCCALLBACKMEMBER(int, pfnRCGstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 3252 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 3253 #if HC_ARCH_BITS == 64 3254 RTRCPTR alignment3; /**< structure size alignment. */ 3255 #endif 3256 3257 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 3258 DECLR0CALLBACKMEMBER(int, pfnR0GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 3259 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 3260 /** @} */ 3261 3262 /** @name Function pointers for Both Shadow and Guest paging. 3263 * @{ 3264 */ 3265 DECLR3CALLBACKMEMBER(int, pfnR3BthRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 3266 /* no pfnR3BthTrap0eHandler */ 3267 DECLR3CALLBACKMEMBER(int, pfnR3BthInvalidatePage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3268 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncCR3,(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)); 3269 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncPage,(PVMCPU pVCpu, X86PDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uError)); 3270 DECLR3CALLBACKMEMBER(int, pfnR3BthPrefetchPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3271 DECLR3CALLBACKMEMBER(int, pfnR3BthVerifyAccessSyncPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fFlags, unsigned uError)); 3272 DECLR3CALLBACKMEMBER(unsigned, pfnR3BthAssertCR3,(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGCPTR GCPtr, RTGCPTR cb)); 3273 DECLR3CALLBACKMEMBER(int, pfnR3BthMapCR3,(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)); 3274 DECLR3CALLBACKMEMBER(int, pfnR3BthUnmapCR3,(PVMCPU pVCpu)); 3275 3276 DECLR0CALLBACKMEMBER(int, pfnR0BthTrap0eHandler,(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken)); 3277 DECLR0CALLBACKMEMBER(int, pfnR0BthInvalidatePage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3278 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncCR3,(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)); 3279 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncPage,(PVMCPU pVCpu, X86PDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uError)); 3280 DECLR0CALLBACKMEMBER(int, pfnR0BthPrefetchPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3281 DECLR0CALLBACKMEMBER(int, pfnR0BthVerifyAccessSyncPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fFlags, unsigned uError)); 3282 DECLR0CALLBACKMEMBER(unsigned, pfnR0BthAssertCR3,(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGCPTR GCPtr, RTGCPTR cb)); 3283 DECLR0CALLBACKMEMBER(int, pfnR0BthMapCR3,(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)); 3284 DECLR0CALLBACKMEMBER(int, pfnR0BthUnmapCR3,(PVMCPU pVCpu)); 3285 3286 DECLRCCALLBACKMEMBER(int, pfnRCBthTrap0eHandler,(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken)); 3287 DECLRCCALLBACKMEMBER(int, pfnRCBthInvalidatePage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3288 DECLRCCALLBACKMEMBER(int, pfnRCBthSyncCR3,(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)); 3289 DECLRCCALLBACKMEMBER(int, pfnRCBthSyncPage,(PVMCPU pVCpu, X86PDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uError)); 3290 DECLRCCALLBACKMEMBER(int, pfnRCBthPrefetchPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3291 DECLRCCALLBACKMEMBER(int, pfnRCBthVerifyAccessSyncPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fFlags, unsigned uError)); 3292 DECLRCCALLBACKMEMBER(unsigned, pfnRCBthAssertCR3,(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGCPTR GCPtr, RTGCPTR cb)); 3293 DECLRCCALLBACKMEMBER(int, pfnRCBthMapCR3,(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)); 3294 DECLRCCALLBACKMEMBER(int, pfnRCBthUnmapCR3,(PVMCPU pVCpu)); 3295 RTRCPTR alignment2; /**< structure size alignment. */ 3296 /** @} */ 3297 3298 /** For saving stack space, the disassembler state is allocated here instead of 3299 * on the stack. 3300 * @note The DISCPUSTATE structure is not R3/R0/RZ clean! */ 3301 union 3302 { 3303 /** The disassembler scratch space. */ 3304 DISCPUSTATE DisState; 3305 /** Padding. */ 3306 uint8_t abDisStatePadding[DISCPUSTATE_PADDING_SIZE]; 3307 }; 3308 3309 /* Count the number of pgm pool access handler calls. */ 3310 uint64_t cPoolAccessHandler; 3311 3312 /** @name Release Statistics 3313 * @{ */ 3314 /** The number of times the guest has switched mode since last reset or statistics reset. */ 3315 STAMCOUNTER cGuestModeChanges; 3316 /** @} */ 3317 3318 #ifdef VBOX_WITH_STATISTICS /** @todo move this chunk to the heap. */ 3319 /** @name Statistics 3320 * @{ */ 3321 /** RC: Which statistic this \#PF should be attributed to. */ 3322 RCPTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionRC; 3323 RTRCPTR padding0; 3324 /** R0: Which statistic this \#PF should be attributed to. */ 3325 R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionR0; 3326 RTR0PTR padding1; 3327 3092 3093 typedef struct PGMCPUSTATS 3094 { 3328 3095 /* Common */ 3329 3096 STAMCOUNTER StatSyncPtPD[X86_PG_ENTRIES]; /**< SyncPT - PD distribution. */ … … 3507 3274 STAMPROFILE StatR3GstModifyPage; /**< R3: Profiling of the PGMGstModifyPage() body */ 3508 3275 /** @} */ 3276 } PGMCPUSTATS; 3277 3278 3279 /** 3280 * Converts a PGMCPU pointer into a VM pointer. 3281 * @returns Pointer to the VM structure the PGM is part of. 3282 * @param pPGM Pointer to PGMCPU instance data. 3283 */ 3284 #define PGMCPU2VM(pPGM) ( (PVM)((char*)(pPGM) - (pPGM)->offVM) ) 3285 3286 /** 3287 * Converts a PGMCPU pointer into a PGM pointer. 3288 * @returns Pointer to the VM structure the PGM is part of. 3289 * @param pPGM Pointer to PGMCPU instance data. 3290 */ 3291 #define PGMCPU2PGM(pPGMCpu) ( (PPGM)((char *)(pPGMCpu) - (pPGMCpu)->offPGM) ) 3292 3293 /** 3294 * PGMCPU Data (part of VMCPU). 3295 */ 3296 typedef struct PGMCPU 3297 { 3298 /** Offset to the VM structure. */ 3299 RTINT offVM; 3300 /** Offset to the VMCPU structure. */ 3301 RTINT offVCpu; 3302 /** Offset of the PGM structure relative to VMCPU. */ 3303 RTINT offPGM; 3304 RTINT uPadding0; /**< structure size alignment. */ 3305 3306 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 3307 /** Automatically tracked physical memory mapping set. 3308 * Ring-0 and strict raw-mode builds. */ 3309 PGMMAPSET AutoSet; 3310 #endif 3311 3312 /** A20 gate mask. 3313 * Our current approach to A20 emulation is to let REM do it and don't bother 3314 * anywhere else. The interesting Guests will be operating with it enabled anyway. 3315 * But whould need arrise, we'll subject physical addresses to this mask. */ 3316 RTGCPHYS GCPhysA20Mask; 3317 /** A20 gate state - boolean! */ 3318 bool fA20Enabled; 3319 /** Mirror of the EFER.NXE bit. Managed by PGMNotifyNxeChanged. */ 3320 bool fNoExecuteEnabled; 3321 /** Unused bits. */ 3322 bool afUnused[2]; 3323 3324 /** What needs syncing (PGM_SYNC_*). 3325 * This is used to queue operations for PGMSyncCR3, PGMInvalidatePage, 3326 * PGMFlushTLB, and PGMR3Load. */ 3327 RTUINT fSyncFlags; 3328 3329 /** The shadow paging mode. */ 3330 PGMMODE enmShadowMode; 3331 /** The guest paging mode. */ 3332 PGMMODE enmGuestMode; 3333 3334 /** The current physical address representing in the guest CR3 register. */ 3335 RTGCPHYS GCPhysCR3; 3336 3337 /** @name 32-bit Guest Paging. 3338 * @{ */ 3339 /** The guest's page directory, R3 pointer. */ 3340 R3PTRTYPE(PX86PD) pGst32BitPdR3; 3341 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3342 /** The guest's page directory, R0 pointer. */ 3343 R0PTRTYPE(PX86PD) pGst32BitPdR0; 3344 #endif 3345 /** The guest's page directory, static RC mapping. */ 3346 RCPTRTYPE(PX86PD) pGst32BitPdRC; 3347 /** Mask containing the MBZ bits of a big page PDE. */ 3348 uint32_t fGst32BitMbzBigPdeMask; 3349 /** Set if the page size extension (PSE) is enabled. */ 3350 bool fGst32BitPageSizeExtension; 3351 /** Alignment padding. */ 3352 bool afAlignment4[3]; 3353 /** @} */ 3354 3355 /** @name PAE Guest Paging. 3356 * @{ */ 3357 /** The guest's page directory pointer table, static RC mapping. */ 3358 RCPTRTYPE(PX86PDPT) pGstPaePdptRC; 3359 /** The guest's page directory pointer table, R3 pointer. */ 3360 R3PTRTYPE(PX86PDPT) pGstPaePdptR3; 3361 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3362 /** The guest's page directory pointer table, R0 pointer. */ 3363 R0PTRTYPE(PX86PDPT) pGstPaePdptR0; 3364 #endif 3365 3366 /** The guest's page directories, R3 pointers. 3367 * These are individual pointers and don't have to be adjecent. 3368 * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */ 3369 R3PTRTYPE(PX86PDPAE) apGstPaePDsR3[4]; 3370 /** The guest's page directories, R0 pointers. 3371 * Same restrictions as apGstPaePDsR3. */ 3372 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3373 R0PTRTYPE(PX86PDPAE) apGstPaePDsR0[4]; 3374 #endif 3375 /** The guest's page directories, static GC mapping. 3376 * Unlike the R3/R0 array the first entry can be accessed as a 2048 entry PD. 3377 * These don't have to be up-to-date - use pgmGstGetPaePD() to access them. */ 3378 RCPTRTYPE(PX86PDPAE) apGstPaePDsRC[4]; 3379 /** The physical addresses of the guest page directories (PAE) pointed to by apGstPagePDsHC/GC. */ 3380 RTGCPHYS aGCPhysGstPaePDs[4]; 3381 /** The physical addresses of the monitored guest page directories (PAE). */ 3382 RTGCPHYS aGCPhysGstPaePDsMonitored[4]; 3383 /** Mask containing the MBZ PTE bits. */ 3384 uint64_t fGstPaeMbzPteMask; 3385 /** Mask containing the MBZ PDE bits. */ 3386 uint64_t fGstPaeMbzPdeMask; 3387 /** Mask containing the MBZ big page PDE bits. */ 3388 uint64_t fGstPaeMbzBigPdeMask; 3389 /** Mask containing the MBZ PDPE bits. */ 3390 uint64_t fGstPaeMbzPdpeMask; 3391 /** @} */ 3392 3393 /** @name AMD64 Guest Paging. 3394 * @{ */ 3395 /** The guest's page directory pointer table, R3 pointer. */ 3396 R3PTRTYPE(PX86PML4) pGstAmd64Pml4R3; 3397 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 3398 /** The guest's page directory pointer table, R0 pointer. */ 3399 R0PTRTYPE(PX86PML4) pGstAmd64Pml4R0; 3400 #else 3401 RTR0PTR alignment6b; /**< alignment equalizer. */ 3402 #endif 3403 /** Mask containing the MBZ PTE bits. */ 3404 uint64_t fGstAmd64MbzPteMask; 3405 /** Mask containing the MBZ PDE bits. */ 3406 uint64_t fGstAmd64MbzPdeMask; 3407 /** Mask containing the MBZ big page PDE bits. */ 3408 uint64_t fGstAmd64MbzBigPdeMask; 3409 /** Mask containing the MBZ PDPE bits. */ 3410 uint64_t fGstAmd64MbzPdpeMask; 3411 /** Mask containing the MBZ big page PDPE bits. */ 3412 uint64_t fGstAmd64MbzBigPdpeMask; 3413 /** Mask containing the MBZ PML4E bits. */ 3414 uint64_t fGstAmd64MbzPml4eMask; 3415 /** @} */ 3416 3417 /** Pointer to the page of the current active CR3 - R3 Ptr. */ 3418 R3PTRTYPE(PPGMPOOLPAGE) pShwPageCR3R3; 3419 /** Pointer to the page of the current active CR3 - R0 Ptr. */ 3420 R0PTRTYPE(PPGMPOOLPAGE) pShwPageCR3R0; 3421 /** Pointer to the page of the current active CR3 - RC Ptr. */ 3422 RCPTRTYPE(PPGMPOOLPAGE) pShwPageCR3RC; 3423 /* The shadow page pool index of the user table as specified during allocation; useful for freeing root pages */ 3424 uint32_t iShwUser; 3425 /* The index into the user table (shadowed) as specified during allocation; useful for freeing root pages. */ 3426 uint32_t iShwUserTable; 3427 # if HC_ARCH_BITS == 64 3428 RTRCPTR alignment6; /**< structure size alignment. */ 3429 # endif 3430 /** @} */ 3431 3432 /** @name Function pointers for Shadow paging. 3433 * @{ 3434 */ 3435 DECLR3CALLBACKMEMBER(int, pfnR3ShwRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 3436 DECLR3CALLBACKMEMBER(int, pfnR3ShwExit,(PVMCPU pVCpu)); 3437 DECLR3CALLBACKMEMBER(int, pfnR3ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 3438 DECLR3CALLBACKMEMBER(int, pfnR3ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)); 3439 3440 DECLRCCALLBACKMEMBER(int, pfnRCShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 3441 DECLRCCALLBACKMEMBER(int, pfnRCShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)); 3442 3443 DECLR0CALLBACKMEMBER(int, pfnR0ShwGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTHCPHYS pHCPhys)); 3444 DECLR0CALLBACKMEMBER(int, pfnR0ShwModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask, uint32_t fOpFlags)); 3445 3446 /** @} */ 3447 3448 /** @name Function pointers for Guest paging. 3449 * @{ 3450 */ 3451 DECLR3CALLBACKMEMBER(int, pfnR3GstRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 3452 DECLR3CALLBACKMEMBER(int, pfnR3GstExit,(PVMCPU pVCpu)); 3453 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 3454 DECLR3CALLBACKMEMBER(int, pfnR3GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 3455 DECLR3CALLBACKMEMBER(int, pfnR3GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 3456 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 3457 DECLRCCALLBACKMEMBER(int, pfnRCGstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 3458 DECLRCCALLBACKMEMBER(int, pfnRCGstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 3459 #if HC_ARCH_BITS == 64 3460 RTRCPTR alignment3; /**< structure size alignment. */ 3461 #endif 3462 3463 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPage,(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys)); 3464 DECLR0CALLBACKMEMBER(int, pfnR0GstModifyPage,(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cbPages, uint64_t fFlags, uint64_t fMask)); 3465 DECLR0CALLBACKMEMBER(int, pfnR0GstGetPDE,(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPde)); 3466 /** @} */ 3467 3468 /** @name Function pointers for Both Shadow and Guest paging. 3469 * @{ 3470 */ 3471 DECLR3CALLBACKMEMBER(int, pfnR3BthRelocate,(PVMCPU pVCpu, RTGCPTR offDelta)); 3472 /* no pfnR3BthTrap0eHandler */ 3473 DECLR3CALLBACKMEMBER(int, pfnR3BthInvalidatePage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3474 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncCR3,(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)); 3475 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncPage,(PVMCPU pVCpu, X86PDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uError)); 3476 DECLR3CALLBACKMEMBER(int, pfnR3BthPrefetchPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3477 DECLR3CALLBACKMEMBER(int, pfnR3BthVerifyAccessSyncPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fFlags, unsigned uError)); 3478 DECLR3CALLBACKMEMBER(unsigned, pfnR3BthAssertCR3,(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGCPTR GCPtr, RTGCPTR cb)); 3479 DECLR3CALLBACKMEMBER(int, pfnR3BthMapCR3,(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)); 3480 DECLR3CALLBACKMEMBER(int, pfnR3BthUnmapCR3,(PVMCPU pVCpu)); 3481 3482 DECLR0CALLBACKMEMBER(int, pfnR0BthTrap0eHandler,(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken)); 3483 DECLR0CALLBACKMEMBER(int, pfnR0BthInvalidatePage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3484 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncCR3,(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)); 3485 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncPage,(PVMCPU pVCpu, X86PDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uError)); 3486 DECLR0CALLBACKMEMBER(int, pfnR0BthPrefetchPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3487 DECLR0CALLBACKMEMBER(int, pfnR0BthVerifyAccessSyncPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fFlags, unsigned uError)); 3488 DECLR0CALLBACKMEMBER(unsigned, pfnR0BthAssertCR3,(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGCPTR GCPtr, RTGCPTR cb)); 3489 DECLR0CALLBACKMEMBER(int, pfnR0BthMapCR3,(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)); 3490 DECLR0CALLBACKMEMBER(int, pfnR0BthUnmapCR3,(PVMCPU pVCpu)); 3491 3492 DECLRCCALLBACKMEMBER(int, pfnRCBthTrap0eHandler,(PVMCPU pVCpu, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, bool *pfLockTaken)); 3493 DECLRCCALLBACKMEMBER(int, pfnRCBthInvalidatePage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3494 DECLRCCALLBACKMEMBER(int, pfnRCBthSyncCR3,(PVMCPU pVCpu, uint64_t cr0, uint64_t cr3, uint64_t cr4, bool fGlobal)); 3495 DECLRCCALLBACKMEMBER(int, pfnRCBthSyncPage,(PVMCPU pVCpu, X86PDE PdeSrc, RTGCPTR GCPtrPage, unsigned cPages, unsigned uError)); 3496 DECLRCCALLBACKMEMBER(int, pfnRCBthPrefetchPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage)); 3497 DECLRCCALLBACKMEMBER(int, pfnRCBthVerifyAccessSyncPage,(PVMCPU pVCpu, RTGCPTR GCPtrPage, unsigned fFlags, unsigned uError)); 3498 DECLRCCALLBACKMEMBER(unsigned, pfnRCBthAssertCR3,(PVMCPU pVCpu, uint64_t cr3, uint64_t cr4, RTGCPTR GCPtr, RTGCPTR cb)); 3499 DECLRCCALLBACKMEMBER(int, pfnRCBthMapCR3,(PVMCPU pVCpu, RTGCPHYS GCPhysCR3)); 3500 DECLRCCALLBACKMEMBER(int, pfnRCBthUnmapCR3,(PVMCPU pVCpu)); 3501 RTRCPTR alignment2; /**< structure size alignment. */ 3502 /** @} */ 3503 3504 /** For saving stack space, the disassembler state is allocated here instead of 3505 * on the stack. 3506 * @note The DISCPUSTATE structure is not R3/R0/RZ clean! */ 3507 union 3508 { 3509 /** The disassembler scratch space. */ 3510 DISCPUSTATE DisState; 3511 /** Padding. */ 3512 uint8_t abDisStatePadding[DISCPUSTATE_PADDING_SIZE]; 3513 }; 3514 3515 /** Count the number of pgm pool access handler calls. */ 3516 uint64_t cPoolAccessHandler; 3517 3518 /** @name Release Statistics 3519 * @{ */ 3520 /** The number of times the guest has switched mode since last reset or statistics reset. */ 3521 STAMCOUNTER cGuestModeChanges; 3522 /** @} */ 3523 3524 #ifdef VBOX_WITH_STATISTICS /** @todo move this chunk to the heap. */ 3525 /** @name Statistics 3526 * @{ */ 3527 /** RC: Pointer to the statistics. */ 3528 RCPTRTYPE(PGMCPUSTATS *) pStatsRC; 3529 /** RC: Which statistic this \#PF should be attributed to. */ 3530 RCPTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionRC; 3531 /** R0: Pointer to the statistics. */ 3532 R0PTRTYPE(PGMCPUSTATS *) pStatsR0; 3533 /** R0: Which statistic this \#PF should be attributed to. */ 3534 R0PTRTYPE(PSTAMPROFILE) pStatTrap0eAttributionR0; 3535 /** R3: Pointer to the statistics. */ 3536 R3PTRTYPE(PGMCPUSTATS *) pStatsR3; 3537 /** Alignment padding. */ 3538 RTR3PTR pPaddingR3; 3539 /** @} */ 3509 3540 #endif /* VBOX_WITH_STATISTICS */ 3510 3541 } PGMCPU; -
trunk/src/VBox/VMM/PGMMap.cpp
r30889 r31123 1192 1192 { 1193 1193 STAM_REL_COUNTER_INC(&pVM->pgm.s.cRelocations); 1194 STAM_PROFILE_START(&pVM->pgm.s. StatR3ResolveConflict, a);1194 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3ResolveConflict, a); 1195 1195 1196 1196 /* Raw mode only which implies one VCPU. */ … … 1245 1245 { 1246 1246 pgmR3MapRelocate(pVM, pMapping, GCPtrOldMapping, GCPtrNewMapping); 1247 STAM_PROFILE_STOP(&pVM->pgm.s. StatR3ResolveConflict, a);1247 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3ResolveConflict, a); 1248 1248 return VINF_SUCCESS; 1249 1249 } 1250 1250 } 1251 1251 1252 STAM_PROFILE_STOP(&pVM->pgm.s. StatR3ResolveConflict, a);1252 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3ResolveConflict, a); 1253 1253 AssertMsgFailed(("Failed to relocate page table mapping '%s' from %#x! (cPTs=%d)\n", pMapping->pszDesc, GCPtrOldMapping, cPTs)); 1254 1254 return VERR_PGM_NO_HYPERVISOR_ADDRESS; … … 1333 1333 { 1334 1334 pgmR3MapRelocate(pVM, pMapping, GCPtrOldMapping, GCPtrNewMapping); 1335 STAM_PROFILE_STOP(&pVM->pgm.s. StatR3ResolveConflict, a);1335 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3ResolveConflict, a); 1336 1336 return VINF_SUCCESS; 1337 1337 } 1338 1338 } 1339 1339 } 1340 STAM_PROFILE_STOP(&pVM->pgm.s. StatR3ResolveConflict, a);1340 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3ResolveConflict, a); 1341 1341 AssertMsgFailed(("Failed to relocate page table mapping '%s' from %#x! (cPTs=%d)\n", pMapping->pszDesc, GCPtrOldMapping, pMapping->cb >> X86_PD_PAE_SHIFT)); 1342 1342 return VERR_PGM_NO_HYPERVISOR_ADDRESS; -
trunk/src/VBox/VMM/PGMPhys.cpp
r31091 r31123 3484 3484 3485 3485 /* Must be callable from any thread, so can't use VMMR3CallR0. */ 3486 STAM_PROFILE_START(&pVM->pgm.s. StatChunkMap, a);3486 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatChunkMap, a); 3487 3487 rc = SUPR3CallVMMR0Ex(pVM->pVMR0, NIL_VMCPUID, VMMR0_DO_GMM_MAP_UNMAP_CHUNK, 0, &Req.Hdr); 3488 STAM_PROFILE_STOP(&pVM->pgm.s. StatChunkMap, a);3488 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatChunkMap, a); 3489 3489 if (RT_SUCCESS(rc)) 3490 3490 { … … 3581 3581 pgmLock(pVM); 3582 3582 3583 STAM_PROFILE_START(&pVM->pgm.s. StatAllocLargePage, a);3583 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a); 3584 3584 int rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_LARGE_HANDY_PAGE, 0, NULL); 3585 STAM_PROFILE_STOP(&pVM->pgm.s. StatAllocLargePage, a);3585 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a); 3586 3586 if (RT_SUCCESS(rc)) 3587 3587 { … … 3608 3608 * Clear the pages. 3609 3609 */ 3610 STAM_PROFILE_START(&pVM->pgm.s. StatClearLargePage, b);3610 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatClearLargePage, b); 3611 3611 for (unsigned i = 0; i < _2M/PAGE_SIZE; i++) 3612 3612 { … … 3618 3618 3619 3619 Assert(PGM_PAGE_IS_ZERO(pPage)); 3620 STAM_COUNTER_INC(&pVM->pgm.s. StatRZPageReplaceZero);3620 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatRZPageReplaceZero); 3621 3621 pVM->pgm.s.cZeroPages--; 3622 3622 … … 3642 3642 Log3(("PGMR3PhysAllocateLargePage: idPage=%#x HCPhys=%RGp\n", idPage, HCPhys)); 3643 3643 } 3644 STAM_PROFILE_STOP(&pVM->pgm.s. StatClearLargePage, b);3644 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatClearLargePage, b); 3645 3645 3646 3646 /* Flush all TLBs. */ -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r31081 r31123 406 406 407 407 Log(("PGMTrap0eHandler: uErr=%RGx pvFault=%RGv eip=%04x:%RGv\n", uErr, pvFault, pRegFrame->cs, (RTGCPTR)pRegFrame->rip)); 408 STAM_PROFILE_START(&pVCpu->pgm.s. StatRZTrap0e, a);408 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0e, a); 409 409 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = NULL; } ); 410 410 … … 419 419 { 420 420 if (uErr & X86_TRAP_PF_RW) 421 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSNotPresentWrite);421 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSNotPresentWrite); 422 422 else 423 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSNotPresentRead);423 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSNotPresentRead); 424 424 } 425 425 else if (uErr & X86_TRAP_PF_RW) 426 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSWrite);426 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSWrite); 427 427 else if (uErr & X86_TRAP_PF_RSVD) 428 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSReserved);428 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSReserved); 429 429 else if (uErr & X86_TRAP_PF_ID) 430 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSNXE);430 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSNXE); 431 431 else 432 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSRead);432 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSRead); 433 433 } 434 434 else … … 437 437 { 438 438 if (uErr & X86_TRAP_PF_RW) 439 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVNotPresentWrite);439 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVNotPresentWrite); 440 440 else 441 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVNotPresentRead);441 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVNotPresentRead); 442 442 } 443 443 else if (uErr & X86_TRAP_PF_RW) 444 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVWrite);444 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVWrite); 445 445 else if (uErr & X86_TRAP_PF_ID) 446 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSNXE);446 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSNXE); 447 447 else if (uErr & X86_TRAP_PF_RSVD) 448 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVReserved);448 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVReserved); 449 449 } 450 450 #endif /* VBOX_WITH_STATISTICS */ … … 476 476 # endif 477 477 478 STAM_STATS({ if (rc == VINF_EM_RAW_GUEST_TRAP) STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eGuestPF); });478 STAM_STATS({ if (rc == VINF_EM_RAW_GUEST_TRAP) STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eGuestPF); }); 479 479 STAM_STATS({ if (!pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution)) 480 pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2Misc; });481 STAM_PROFILE_STOP_EX(&pVCpu->pgm.s. StatRZTrap0e, pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);480 pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Misc; }); 481 STAM_PROFILE_STOP_EX(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0e, pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a); 482 482 return rc; 483 483 } … … 499 499 VMMDECL(int) PGMPrefetchPage(PVMCPU pVCpu, RTGCPTR GCPtrPage) 500 500 { 501 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,Prefetch), a);501 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Prefetch), a); 502 502 int rc = PGM_BTH_PFN(PrefetchPage, pVCpu)(pVCpu, GCPtrPage); 503 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,Prefetch), a);503 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,Prefetch), a); 504 504 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc)); 505 505 return rc; … … 732 732 LogFlow(("PGMGCInvalidatePage: Conflict!\n")); 733 733 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 734 STAM_COUNTER_INC(&pVM->pgm.s. StatRCInvlPgConflict);734 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatRCInvlPgConflict); 735 735 return VINF_PGM_SYNC_CR3; 736 736 } … … 739 739 { 740 740 LogFlow(("PGMGCInvalidatePage: PGM_SYNC_MONITOR_CR3 -> reinterpret instruction in R3\n")); 741 STAM_COUNTER_INC(&pVM->pgm.s. StatRCInvlPgSyncMonCR3);741 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatRCInvlPgSyncMonCR3); 742 742 return VINF_EM_RAW_EMULATE_INSTR; 743 743 } … … 748 748 * Call paging mode specific worker. 749 749 */ 750 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePage), a);750 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage), a); 751 751 pgmLock(pVM); 752 752 rc = PGM_BTH_PFN(InvalidatePage, pVCpu)(pVCpu, GCPtrPage); 753 753 pgmUnlock(pVM); 754 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePage), a);754 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage), a); 755 755 756 756 /* Invalidate the TLB entry; might already be done by InvalidatePage (@todo) */ … … 1342 1342 VMMDECL(int) PGMGstModifyPage(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask) 1343 1343 { 1344 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,GstModifyPage), a);1344 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,GstModifyPage), a); 1345 1345 1346 1346 /* … … 1364 1364 int rc = PGM_GST_PFN(ModifyPage, pVCpu)(pVCpu, GCPtr, cb, fFlags, fMask); 1365 1365 1366 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,GstModifyPage), a);1366 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,GstModifyPage), a); 1367 1367 return rc; 1368 1368 } … … 1718 1718 PVM pVM = pVCpu->CTX_SUFF(pVM); 1719 1719 1720 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,FlushTLB), a);1720 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,FlushTLB), a); 1721 1721 1722 1722 /* … … 1770 1770 1771 1771 if (fGlobal) 1772 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,FlushTLBNewCR3Global));1772 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,FlushTLBNewCR3Global)); 1773 1773 else 1774 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,FlushTLBNewCR3));1774 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,FlushTLBNewCR3)); 1775 1775 } 1776 1776 else … … 1794 1794 } 1795 1795 if (fGlobal) 1796 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,FlushTLBSameCR3Global));1796 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,FlushTLBSameCR3Global)); 1797 1797 else 1798 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,FlushTLBSameCR3));1799 } 1800 1801 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,FlushTLB), a);1798 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,FlushTLBSameCR3)); 1799 } 1800 1801 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,FlushTLB), a); 1802 1802 return rc; 1803 1803 } … … 1961 1961 * Let the 'Bth' function do the work and we'll just keep track of the flags. 1962 1962 */ 1963 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncCR3), a);1963 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 1964 1964 rc = PGM_BTH_PFN(SyncCR3, pVCpu)(pVCpu, cr0, cr3, cr4, fGlobal); 1965 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncCR3), a);1965 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 1966 1966 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 || RT_FAILURE(rc), ("rc=%Rrc\n", rc)); 1967 1967 if (rc == VINF_SUCCESS) … … 2410 2410 void *pv = pVM->pgm.s.pbDynPageMapBaseGC + (iPage << PAGE_SHIFT); 2411 2411 *ppv = pv; 2412 STAM_COUNTER_INC(&pVM->pgm.s. StatRCDynMapCacheHits);2412 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatRCDynMapCacheHits); 2413 2413 Log4(("PGMGCDynMapHCPage: HCPhys=%RHp pv=%p iPage=%d iCache=%d\n", HCPhys, pv, iPage, iCache)); 2414 2414 return VINF_SUCCESS; … … 2419 2419 AssertCompile(RT_ELEMENTS(pVM->pgm.s.aHCPhysDynPageMapCache) == 8); 2420 2420 AssertCompile((MM_HYPER_DYNAMIC_SIZE >> PAGE_SHIFT) == 16); 2421 STAM_COUNTER_INC(&pVM->pgm.s. StatRCDynMapCacheMisses);2421 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatRCDynMapCacheMisses); 2422 2422 2423 2423 /* … … 2711 2711 VMMDECL(unsigned) PGMAssertCR3(PVM pVM, PVMCPU pVCpu, uint64_t cr3, uint64_t cr4) 2712 2712 { 2713 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncCR3), a);2713 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 2714 2714 pgmLock(pVM); 2715 2715 unsigned cErrors = PGM_BTH_PFN(AssertCR3, pVCpu)(pVCpu, cr3, cr4, 0, ~(RTGCPTR)0); 2716 2716 pgmUnlock(pVM); 2717 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncCR3), a);2717 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3), a); 2718 2718 return cErrors; 2719 2719 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r31119 r31123 101 101 /* Force a CR3 sync to check for conflicts and emulate the instruction. */ 102 102 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 103 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2GuestTrap; });103 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2GuestTrap; }); 104 104 return VINF_EM_RAW_EMULATE_INSTR; 105 105 } … … 121 121 TRPMSetErrorCode(pVCpu, uNewErr); 122 122 123 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2GuestTrap; });123 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2GuestTrap; }); 124 124 return VINF_EM_RAW_GUEST_TRAP; 125 125 } … … 186 186 { 187 187 AssertRC(rc); 188 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersOutOfSync);189 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2OutOfSyncHndPhys; });188 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersOutOfSync); 189 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2OutOfSyncHndPhys; }); 190 190 return rc; 191 191 } … … 230 230 rc = VINF_EM_RAW_EMULATE_INSTR; 231 231 232 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersPhysical);233 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2HndPhys; });232 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersPhysical); 233 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2HndPhys; }); 234 234 return rc; 235 235 } … … 253 253 { 254 254 AssertRC(rc); 255 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersOutOfSync);256 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2OutOfSyncHndVirt; });255 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersOutOfSync); 256 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2OutOfSyncHndVirt; }); 257 257 return rc; 258 258 } … … 293 293 rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */ 294 294 # endif 295 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersVirtual);296 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2HndVirt; });295 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersVirtual); 296 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2HndVirt; }); 297 297 return rc; 298 298 } … … 321 321 rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */ 322 322 # endif 323 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersVirtualByPhys);324 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2HndVirt; });323 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersVirtualByPhys); 324 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2HndVirt; }); 325 325 return rc; 326 326 } … … 337 337 * write access handlers. Restart the instruction if it wasn't a write access. 338 338 */ 339 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersUnhandled);339 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersUnhandled); 340 340 341 341 if ( !PGM_PAGE_HAS_ACTIVE_ALL_HANDLERS(pPage) … … 352 352 { 353 353 AssertRC(rc); 354 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersOutOfSync);355 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2OutOfSyncHndPhys; });354 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersOutOfSync); 355 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2OutOfSyncHndPhys; }); 356 356 return rc; 357 357 } … … 363 363 rc = PGMInterpretInstruction(pVM, pVCpu, pRegFrame, pvFault); 364 364 LogFlow(("PGM: PGMInterpretInstruction -> rc=%d pPage=%R[pgmpage]\n", rc, pPage)); 365 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2HndUnhandled; });365 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2HndUnhandled; }); 366 366 return rc; 367 367 } /* if any kind of handler */ … … 484 484 # ifdef VBOX_WITH_STATISTICS 485 485 if (!GstWalk.Pte.n.u1Dirty) 486 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtiedPage));486 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtiedPage)); 487 487 else 488 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageAlreadyDirty));488 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageAlreadyDirty)); 489 489 # endif 490 490 GstWalk.Pte.u |= X86_PTE_A | X86_PTE_D; … … 553 553 if (uErr & X86_TRAP_PF_RW) /* write fault? */ 554 554 { 555 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyBitTracking), a);555 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyBitTracking), a); 556 556 rc = PGM_BTH_NAME(CheckDirtyPageFault)(pVCpu, uErr, &pPDDst->a[iPDDst], GstWalk.pPde, pvFault); 557 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyBitTracking), a);557 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyBitTracking), a); 558 558 if (rc == VINF_PGM_HANDLED_DIRTY_BIT_FAULT) 559 559 { 560 560 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) 561 = rc == VINF_PGM_HANDLED_DIRTY_BIT_FAULT ? &pVCpu->pgm.s.StatRZTrap0eTime2DirtyAndAccessed : &pVCpu->pgm.s.StatRZTrap0eTime2GuestTrap; }); 561 = rc == VINF_PGM_HANDLED_DIRTY_BIT_FAULT 562 ? &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2DirtyAndAccessed 563 : &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2GuestTrap; }); 562 564 LogBird(("Trap0eHandler: returns VINF_SUCCESS\n")); 563 565 return VINF_SUCCESS; … … 590 592 && !pPDDst->a[iPDDst].n.u1Present) 591 593 { 592 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2SyncPT; });594 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2SyncPT; }); 593 595 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) 594 596 LogFlow(("=>SyncPT %04x = %08RX64\n", (pvFault >> GST_PD_SHIFT) & GST_PD_MASK, (uint64_t)GstWalk.Pde.u)); … … 631 633 if (GstWalk.pPde[iPT].n.u1Present) 632 634 { 633 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eConflicts);635 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eConflicts); 634 636 Log(("Trap0e: Detected Conflict %RGv-%RGv\n", pMapping->GCPtr, pMapping->GCPtrLast)); 635 637 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); /** @todo no need to do global sync,right? */ 636 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2Mapping; });638 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Mapping; }); 637 639 return VINF_PGM_SYNC_CR3; 638 640 } … … 657 659 rc = VINF_EM_RAW_EMULATE_INSTR; /* can't happen with VMX */ 658 660 # endif 659 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersMapping);660 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2Mapping; });661 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersMapping); 662 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Mapping; }); 661 663 return rc; 662 664 } … … 666 668 */ 667 669 TRPMSetErrorCode(pVCpu, uErr & ~X86_TRAP_PF_P); 668 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eGuestPFMapping);670 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eGuestPFMapping); 669 671 LogFlow(("PGM: Mapping access -> route trap to recompiler!\n")); 670 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2Mapping; });672 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Mapping; }); 671 673 return VINF_EM_RAW_GUEST_TRAP; 672 674 } … … 698 700 */ 699 701 LogFlow(("PGM #PF: pgmPhysGetPageEx(%RGp) failed with %Rrc\n", GCPhys, rc)); 700 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eHandlersInvalid);701 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2InvalidPhys; });702 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eHandlersInvalid); 703 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2InvalidPhys; }); 702 704 return VINF_EM_RAW_EMULATE_INSTR; 703 705 } … … 713 715 # endif 714 716 715 STAM_PROFILE_START(&pVCpu->pgm.s. StatRZTrap0eTimeOutOfSync, c);717 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTimeOutOfSync, c); 716 718 717 719 # if PGM_WITH_PAGING(PGM_GST_TYPE, PGM_SHW_TYPE) … … 747 749 rc = VINF_EM_RAW_EMULATE_INSTR; /** @todo for VMX */ 748 750 # endif 749 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2HndVirt; });751 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2HndVirt; }); 750 752 return rc; 751 753 } … … 766 768 */ 767 769 if (uErr & X86_TRAP_PF_US) 768 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncUser));770 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncUser)); 769 771 else /* supervisor */ 770 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncSupervisor));772 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncSupervisor)); 771 773 772 774 if (PGM_PAGE_IS_BALLOONED(pPage)) … … 777 779 rc = PGMInterpretInstruction(pVM, pVCpu, pRegFrame, pvFault); 778 780 LogFlow(("PGM: PGMInterpretInstruction balloon -> rc=%d pPage=%R[pgmpage]\n", rc, pPage)); 779 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncBallloon));780 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2Ballooned; });781 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncBallloon)); 782 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Ballooned; }); 781 783 return rc; 782 784 } … … 822 824 AssertRC(rc2); 823 825 824 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2CSAM; });826 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2CSAM; }); 825 827 return rc; 826 828 } … … 874 876 { 875 877 /* The page was successfully synced, return to the guest. */ 876 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2OutOfSync; });878 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2OutOfSync; }); 877 879 return VINF_SUCCESS; 878 880 } … … 901 903 Assert(!PGM_PAGE_IS_ZERO(pPage)); 902 904 AssertFatalMsg(!PGM_PAGE_IS_BALLOONED(pPage), ("Unexpected ballooned page at %RGp\n", GCPhys)); 903 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2MakeWritable; });905 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2MakeWritable; }); 904 906 905 907 rc = pgmPhysPageMakeWritable(pVM, pPage, GCPhys); … … 924 926 rc = PGMInterpretInstruction(pVM, pVCpu, pRegFrame, pvFault); 925 927 if (RT_SUCCESS(rc)) 926 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eWPEmulInRZ);928 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eWPEmulInRZ); 927 929 else 928 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eWPEmulToR3);929 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2WPEmulation; });930 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eWPEmulToR3); 931 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2WPEmulation; }); 930 932 return rc; 931 933 } … … 933 935 /// @todo count the above case; else 934 936 if (uErr & X86_TRAP_PF_US) 935 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncUserWrite));937 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncUserWrite)); 936 938 else /* supervisor */ 937 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncSupervisorWrite));939 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncSupervisorWrite)); 938 940 939 941 /* … … 972 974 AssertMsg((RT_SUCCESS(rc) && (fPageShw & X86_PTE_RW)) || pVM->cCpus > 1 /* new monitor can be installed/page table flushed between the trap exit and PGMTrap0eHandler */, ("rc=%Rrc fPageShw=%RX64\n", rc, fPageShw)); 973 975 # endif /* VBOX_STRICT */ 974 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2OutOfSyncHndObs; });976 STAM_STATS({ pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2OutOfSyncHndObs; }); 975 977 return VINF_SUCCESS; 976 978 } … … 1017 1019 */ 1018 1020 LogFlow(("PGM: Unhandled #PF -> route trap to recompiler!\n")); 1019 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eGuestPFUnh);1021 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eGuestPFUnh); 1020 1022 return VINF_EM_RAW_GUEST_TRAP; 1021 1023 # else … … 1091 1093 { 1092 1094 Assert(!(pPdptDst->a[iPdpt].u & PGM_PLXFLAGS_MAPPING)); 1093 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePageSkipped));1095 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePageSkipped)); 1094 1096 return VINF_SUCCESS; 1095 1097 } … … 1119 1121 { 1120 1122 AssertMsg(rc == VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT || rc == VERR_PAGE_MAP_LEVEL4_NOT_PRESENT, ("Unexpected rc=%Rrc\n", rc)); 1121 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePageSkipped));1123 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePageSkipped)); 1122 1124 return VINF_SUCCESS; 1123 1125 } … … 1129 1131 if (!pPdpeDst->n.u1Present) 1130 1132 { 1131 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePageSkipped));1133 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePageSkipped)); 1132 1134 return VINF_SUCCESS; 1133 1135 } … … 1142 1144 if (!PdeDst.n.u1Present) 1143 1145 { 1144 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePageSkipped));1146 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePageSkipped)); 1145 1147 return VINF_SUCCESS; 1146 1148 } … … 1194 1196 # endif 1195 1197 { 1196 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePageSkipped));1198 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePageSkipped)); 1197 1199 return VINF_SUCCESS; 1198 1200 } … … 1253 1255 rc = VINF_SUCCESS; 1254 1256 # endif 1255 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePage4KBPages));1257 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage4KBPages)); 1256 1258 PGM_INVL_PG(pVCpu, GCPtrPage); 1257 1259 } … … 1265 1267 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1266 1268 ASMAtomicWriteSize(pPdeDst, 0); 1267 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePagePDOutOfSync));1269 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePagePDOutOfSync)); 1268 1270 PGM_INVL_VCPU_TLBS(pVCpu); 1269 1271 } … … 1292 1294 { 1293 1295 LogFlow(("Skipping flush for big page containing %RGv (PD=%X .u=%RX64)-> nothing has changed!\n", GCPtrPage, iPDSrc, PdeSrc.u)); 1294 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePage4MBPagesSkip));1296 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage4MBPagesSkip)); 1295 1297 # if defined(IN_RC) 1296 1298 /* Make sure the dynamic pPdeDst mapping will not be reused during this function. */ … … 1311 1313 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1312 1314 ASMAtomicWriteSize(pPdeDst, 0); 1313 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePage4MBPages));1315 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePage4MBPages)); 1314 1316 PGM_INVL_BIG_PG(pVCpu, GCPtrPage); 1315 1317 } … … 1324 1326 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1325 1327 ASMAtomicWriteSize(pPdeDst, 0); 1326 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePagePDNPs));1328 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePagePDNPs)); 1327 1329 PGM_INVL_PG(pVCpu, GCPtrPage); 1328 1330 } … … 1330 1332 { 1331 1333 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 1332 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,InvalidatePagePDMappings));1334 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,InvalidatePagePDMappings)); 1333 1335 } 1334 1336 } … … 1358 1360 PVM pVM = pVCpu->CTX_SUFF(pVM); 1359 1361 1360 STAM_PROFILE_START(&pVM->pgm.s. StatTrackDeref, a);1362 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackDeref, a); 1361 1363 LogFlow(("SyncPageWorkerTrackDeref: Damn HCPhys=%RHp pShwPage->idx=%#x!!!\n", HCPhys, pShwPage->idx)); 1362 1364 … … 1387 1389 1388 1390 pgmTrackDerefGCPhys(pPool, pShwPage, &pRam->aPages[iPage], iPte); 1389 STAM_PROFILE_STOP(&pVM->pgm.s. StatTrackDeref, a);1391 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackDeref, a); 1390 1392 return; 1391 1393 } … … 1415 1417 if (!u16) 1416 1418 { 1417 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackVirgin);1419 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackVirgin); 1418 1420 u16 = PGMPOOL_TD_MAKE(1, pShwPage->idx); 1419 1421 /* Save the page table index. */ … … 1593 1595 { 1594 1596 LogFlow(("SyncPageWorker: page and or page directory not accessed -> mark not present\n")); 1595 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,AccessedPage));1597 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,AccessedPage)); 1596 1598 PteDst.u = 0; 1597 1599 } … … 1602 1604 else if (!PteSrc.n.u1Dirty && (PdeSrc.n.u1Write & PteSrc.n.u1Write)) 1603 1605 { 1604 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPage));1606 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPage)); 1605 1607 PteDst.u = (PteSrc.u & ~(X86_PTE_PAE_PG_MASK | X86_PTE_AVL_MASK | X86_PTE_PAT | X86_PTE_PCD | X86_PTE_PWT | X86_PTE_RW)) 1606 1608 | PGM_PAGE_GET_HCPHYS(pPage) … … 1610 1612 #endif 1611 1613 { 1612 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageSkipped));1614 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageSkipped)); 1613 1615 #if PGM_SHW_TYPE == PGM_TYPE_EPT 1614 1616 PteDst.u = PGM_PAGE_GET_HCPHYS(pPage); … … 1999 2001 && PdeSrc.b.u1Write) 2000 2002 { 2001 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageBig));2003 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageBig)); 2002 2004 PdeDst.u |= PGM_PDFLAGS_TRACK_DIRTY; 2003 2005 PdeDst.n.u1Write = 0; … … 2026 2028 } 2027 2029 2028 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPagePDNAs));2030 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPagePDNAs)); 2029 2031 } 2030 2032 else if (fPdeValid) 2031 2033 { 2032 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPagePDOutOfSync));2034 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPagePDOutOfSync)); 2033 2035 Log2(("SyncPage: Out-Of-Sync PDE at %RGp PdeSrc=%RX64 PdeDst=%RX64 (GCPhys %RGp vs %RGp)\n", 2034 2036 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u, pShwPage->GCPhys, GCPhys)); … … 2216 2218 DECLINLINE(int) PGM_BTH_NAME(CheckPageFaultReturnNP)(PVMCPU pVCpu, uint32_t uErr, RTGCPTR GCPtrPage, unsigned uPageFaultLevel) 2217 2219 { 2218 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyTrackRealPF));2220 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyTrackRealPF)); 2219 2221 AssertMsg(!(uErr & X86_TRAP_PF_P), ("%#x\n", uErr)); 2220 2222 AssertMsg(!(uErr & X86_TRAP_PF_RSVD), ("%#x\n", uErr)); … … 2240 2242 DECLINLINE(int) PGM_BTH_NAME(CheckPageFaultReturnRSVD)(PVMCPU pVCpu, uint32_t uErr, RTGCPTR GCPtrPage, unsigned uPageFaultLevel) 2241 2243 { 2242 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyTrackRealPF));2244 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyTrackRealPF)); 2243 2245 if ((uErr & (X86_TRAP_PF_RSVD | X86_TRAP_PF_P)) != (X86_TRAP_PF_RSVD | X86_TRAP_PF_P)) 2244 2246 TRPMSetErrorCode(pVCpu, uErr | X86_TRAP_PF_RSVD | X86_TRAP_PF_P); … … 2261 2263 DECLINLINE(int) PGM_BTH_NAME(CheckPageFaultReturnProt)(PVMCPU pVCpu, uint32_t uErr, RTGCPTR GCPtrPage, unsigned uPageFaultLevel) 2262 2264 { 2263 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyTrackRealPF));2265 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyTrackRealPF)); 2264 2266 AssertMsg(uErr & (X86_TRAP_PF_RW | X86_TRAP_PF_US | X86_TRAP_PF_ID), ("%#x\n", uErr)); 2265 2267 if ((uErr & (X86_TRAP_PF_P | X86_TRAP_PF_RSVD)) != X86_TRAP_PF_P) … … 2455 2457 # ifdef VBOX_WITH_STATISTICS 2456 2458 if (!pPteSrc->n.u1Dirty) 2457 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtiedPage));2459 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtiedPage)); 2458 2460 else 2459 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageAlreadyDirty));2461 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageAlreadyDirty)); 2460 2462 # endif 2461 2463 … … 2494 2496 SHWPDE PdeDst = *pPdeDst; 2495 2497 2496 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageTrap));2498 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageTrap)); 2497 2499 Assert(pPdeSrc->b.u1Write); 2498 2500 … … 2523 2525 { 2524 2526 /* Stale TLB entry. */ 2525 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageStale));2527 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageStale)); 2526 2528 PGM_INVL_PG(pVCpu, GCPtrPage); 2527 2529 return VINF_PGM_HANDLED_DIRTY_BIT_FAULT; /* restarts the instruction. */ … … 2575 2577 2576 2578 LogFlow(("DIRTY page trap addr=%RGv\n", GCPtrPage)); 2577 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageTrap));2579 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageTrap)); 2578 2580 2579 2581 Assert(pPteSrc->n.u1Write); … … 2628 2630 { 2629 2631 /* Stale TLB entry. */ 2630 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageStale));2632 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageStale)); 2631 2633 PGM_INVL_PG(pVCpu, GCPtrPage); 2632 2634 return VINF_PGM_HANDLED_DIRTY_BIT_FAULT; /* restarts the instruction. */ … … 2663 2665 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 2664 2666 2665 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);2667 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 2666 2668 #if 0 /* rarely useful; leave for debugging. */ 2667 2669 STAM_COUNTER_INC(&pVCpu->pgm.s.StatSyncPtPD[iPDSrc]); … … 2734 2736 # ifndef IN_RING3 2735 2737 Log(("SyncPT: Conflict at %RGv\n", GCPtrPage)); 2736 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);2738 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 2737 2739 return VERR_ADDRESS_CONFLICT; 2738 2740 … … 2749 2751 if (RT_FAILURE(rc)) 2750 2752 { 2751 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);2753 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 2752 2754 return rc; 2753 2755 } … … 2834 2836 && PdeSrc.b.u1Write) 2835 2837 { 2836 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageBig));2838 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageBig)); 2837 2839 PdeDst.u |= PGM_PDFLAGS_TRACK_DIRTY; 2838 2840 PdeDst.b.u1Write = 0; … … 2898 2900 * 2899 2901 */ 2900 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT4K));2902 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT4K)); 2901 2903 # ifdef PGM_SYNC_N_PAGES 2902 2904 unsigned iPTBase = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK; … … 2959 2961 * We will only sync on shadow page table at a time. 2960 2962 */ 2961 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT4M));2963 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT4M)); 2962 2964 2963 2965 /** … … 2984 2986 && PdeSrc.b.u1Write) 2985 2987 { 2986 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,DirtyPageBig));2988 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,DirtyPageBig)); 2987 2989 PdeDst.u |= PGM_PDFLAGS_TRACK_DIRTY; 2988 2990 PdeDst.b.u1Write = 0; … … 3123 3125 AssertRelease(!PdeDst.n.u1Present); 3124 3126 3125 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);3127 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 3126 3128 if (RT_FAILURE(rc)) 3127 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPTFailed));3129 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPTFailed)); 3128 3130 return rc; 3129 3131 … … 3182 3184 if (rc != VINF_SUCCESS) 3183 3185 { 3184 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);3186 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 3185 3187 AssertRC(rc); 3186 3188 return rc; … … 3259 3261 PGM_BTH_NAME(SyncPageWorkerTrackAddref)(pVCpu, pShwPde, PGM_PAGE_GET_TRACKING(pPage), pPage, iPDDst); 3260 3262 3261 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);3263 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 3262 3264 return VINF_SUCCESS; 3263 3265 } … … 3303 3305 3304 3306 rc = PGM_BTH_NAME(SyncPage)(pVCpu, PdeSrc, GCPtrPage, PGM_SYNC_NR_PAGES, 0 /* page not present */); 3305 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);3307 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 3306 3308 return rc; 3307 3309 3308 3310 #else 3309 3311 AssertReleaseMsgFailed(("Shw=%d Gst=%d is not implemented!\n", PGM_SHW_TYPE, PGM_GST_TYPE)); 3310 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncPT), a);3312 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncPT), a); 3311 3313 return VERR_INTERNAL_ERROR; 3312 3314 #endif … … 3626 3628 Assert(rc != VINF_EM_RAW_GUEST_TRAP); 3627 3629 if (uErr & X86_TRAP_PF_US) 3628 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncUser));3630 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncUser)); 3629 3631 else /* supervisor */ 3630 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_ MID_Z(Stat,PageOutOfSyncSupervisor));3632 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageOutOfSyncSupervisor)); 3631 3633 3632 3634 rc = PGM_BTH_NAME(SyncPage)(pVCpu, PdeSrc, GCPtrPage, 1, 0); … … 3693 3695 */ 3694 3696 /** @todo this MUST go away. See #1557. */ 3695 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncCR3Handlers), h);3697 STAM_PROFILE_START(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3Handlers), h); 3696 3698 PGM_GST_NAME(HandlerVirtualUpdate)(pVM, cr4); 3697 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_ MID_Z(Stat,SyncCR3Handlers), h);3699 STAM_PROFILE_STOP(&pVCpu->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3Handlers), h); 3698 3700 pgmUnlock(pVM); 3699 3701 #endif /* !NESTED && !EPT */ -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r31081 r31123 653 653 654 654 pgmLock(pVM); 655 STAM_PROFILE_START(&pVM->pgm.s.CTX_ MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a);655 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a); 656 656 657 657 for (VMCPUID i = 0; i < pVM->cCpus; i++) … … 668 668 fTodo |= State.fTodo; 669 669 } 670 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_ MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a);670 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3HandlerVirtualUpdate), a); 671 671 672 672 … … 676 676 if (fTodo & PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL) 677 677 { 678 STAM_PROFILE_START(&pVM->pgm.s.CTX_ MID_Z(Stat,SyncCR3HandlerVirtualReset), b);678 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3HandlerVirtualReset), b); 679 679 Log(("HandlerVirtualUpdate: resets bits\n")); 680 680 RTAvlroGCPtrDoWithAll(&pVM->pgm.s.CTX_SUFF(pTrees)->VirtHandlers, true, pgmHandlerVirtualResetOne, pVM); … … 686 686 } 687 687 688 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_ MID_Z(Stat,SyncCR3HandlerVirtualReset), b);688 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,SyncCR3HandlerVirtualReset), b); 689 689 } 690 690 pgmUnlock(pVM); -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r29250 r31123 819 819 case PGMPHYSHANDLERTYPE_MMIO: /* NOTE: Only use when clearing MMIO ranges with aliased MMIO2 pages! */ 820 820 { 821 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysHandlerReset)); /**@Todo move out of switch */821 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysHandlerReset)); /**@Todo move out of switch */ 822 822 PPGMRAMRANGE pRam = pgmPhysGetRange(&pVM->pgm.s, GCPhys); 823 823 Assert(pRam); … … 1271 1271 #endif 1272 1272 LogFlow(("PHYS2VIRT: found match for %RGp -> %RGv *piPage=%#x\n", GCPhys, (*ppVirt)->Core.Key, *piPage)); 1273 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_ MID_Z(Stat,VirtHandlerSearchByPhys), a);1273 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,VirtHandlerSearchByPhys), a); 1274 1274 return VINF_SUCCESS; 1275 1275 } … … 1277 1277 pgmUnlock(pVM); 1278 1278 *ppVirt = NULL; 1279 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_ MID_Z(Stat,VirtHandlerSearchByPhys), a);1279 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,VirtHandlerSearchByPhys), a); 1280 1280 return VERR_PGM_HANDLER_NOT_FOUND; 1281 1281 } -
trunk/src/VBox/VMM/VMMAll/PGMAllMap.cpp
r31081 r31123 732 732 && (pVM->fRawR0Enabled || pPD->a[iPDE + iPT].n.u1User)) 733 733 { 734 STAM_COUNTER_INC(&pVM->pgm.s. StatR3DetectedConflicts);734 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3DetectedConflicts); 735 735 736 736 #ifdef IN_RING3 … … 764 764 && (pVM->fRawR0Enabled || Pde.n.u1User)) 765 765 { 766 STAM_COUNTER_INC(&pVM->pgm.s. StatR3DetectedConflicts);766 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3DetectedConflicts); 767 767 #ifdef IN_RING3 768 768 Log(("PGMHasMappingConflicts: Conflict was detected at %RGv for mapping %s (PAE)\n" … … 827 827 || pPD->a[iPDE + iPT].n.u1User)) 828 828 { 829 STAM_COUNTER_INC(&pVM->pgm.s. StatR3DetectedConflicts);829 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3DetectedConflicts); 830 830 831 831 #ifdef IN_RING3 … … 867 867 && (pVM->fRawR0Enabled || Pde.n.u1User)) 868 868 { 869 STAM_COUNTER_INC(&pVM->pgm.s. StatR3DetectedConflicts);869 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatR3DetectedConflicts); 870 870 #ifdef IN_RING3 871 871 Log(("PGMHasMappingConflicts: Conflict was detected at %RGv for mapping %s (PAE)\n" -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r30766 r31123 110 110 case OP_MOV: 111 111 pRegFrame->rip += cbOp; 112 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZGuestROMWriteHandled);112 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestROMWriteHandled); 113 113 return VINF_SUCCESS; 114 114 } … … 136 136 } 137 137 138 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZGuestROMWriteUnhandled);138 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestROMWriteUnhandled); 139 139 return VINF_EM_RAW_EMULATE_INSTR; 140 140 } … … 221 221 { 222 222 pgmLock(pVM); 223 STAM_COUNTER_INC(&pVM->pgm.s. StatPageMapTlbFlushes);223 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatPageMapTlbFlushes); 224 224 /* Clear the shared R0/R3 TLB completely. */ 225 225 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.PhysTlbHC.aEntries); i++) … … 244 244 Assert(PGMIsLocked(pVM)); 245 245 246 STAM_COUNTER_INC(&pVM->pgm.s. StatPageMapTlbFlushEntry);246 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatPageMapTlbFlushEntry); 247 247 /* Clear the shared R0/R3 TLB entry. */ 248 248 #ifdef IN_RC … … 444 444 Log(("PGM: Replaced shared page %#x at %RGp with %#x / %RHp\n", PGM_PAGE_GET_PAGEID(pPage), 445 445 GCPhys, pVM->pgm.s.aHandyPages[iHandyPage].idPage, HCPhys)); 446 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,PageReplaceShared));446 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageReplaceShared)); 447 447 pVM->pgm.s.cSharedPages--; 448 448 … … 454 454 { 455 455 Log2(("PGM: Replaced zero page %RGp with %#x / %RHp\n", GCPhys, pVM->pgm.s.aHandyPages[iHandyPage].idPage, HCPhys)); 456 STAM_COUNTER_INC(&pVM->pgm.s. StatRZPageReplaceZero);456 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatRZPageReplaceZero); 457 457 pVM->pgm.s.cZeroPages--; 458 458 } … … 614 614 } 615 615 616 STAM_PROFILE_START(&pVM->pgm.s.CTX_ MID_Z(Stat,IsValidLargePage), a);616 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,IsValidLargePage), a); 617 617 /* Check all remaining pages in the 2 MB range. */ 618 618 GCPhys += PAGE_SIZE; … … 634 634 GCPhys += PAGE_SIZE; 635 635 } 636 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_ MID_Z(Stat,IsValidLargePage), a);636 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,IsValidLargePage), a); 637 637 638 638 if (i == _2M/PAGE_SIZE) … … 759 759 if (pTlbe->idChunk == idChunk) 760 760 { 761 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,ChunkR3MapTlbHits));761 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,ChunkR3MapTlbHits)); 762 762 pMap = pTlbe->pChunk; 763 763 } 764 764 else 765 765 { 766 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,ChunkR3MapTlbMisses));766 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,ChunkR3MapTlbMisses)); 767 767 768 768 /* … … 877 877 if (pTlbe->idChunk == idChunk) 878 878 { 879 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,ChunkR3MapTlbHits));879 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,ChunkR3MapTlbHits)); 880 880 pMap = pTlbe->pChunk; 881 881 } 882 882 else 883 883 { 884 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,ChunkR3MapTlbMisses));884 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,ChunkR3MapTlbMisses)); 885 885 886 886 /* … … 1021 1021 { 1022 1022 Assert(PGMIsLocked(PGM2VM(pPGM))); 1023 STAM_COUNTER_INC(&pPGM->CTX_ MID_Z(Stat,PageMapTlbMisses));1023 STAM_COUNTER_INC(&pPGM->CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageMapTlbMisses)); 1024 1024 1025 1025 /* … … 1089 1089 { 1090 1090 Assert(PGMIsLocked(PGM2VM(pPGM))); 1091 STAM_COUNTER_INC(&pPGM->CTX_ MID_Z(Stat,PageMapTlbMisses));1091 STAM_COUNTER_INC(&pPGM->CTX_SUFF(pStats)->CTX_MID_Z(Stat,PageMapTlbMisses)); 1092 1092 1093 1093 /* … … 1860 1860 LogFlow(("PGMPhysRead: %RGp %d\n", GCPhys, cbRead)); 1861 1861 1862 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysRead));1863 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysReadBytes), cbRead);1862 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysRead)); 1863 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysReadBytes), cbRead); 1864 1864 1865 1865 pgmLock(pVM); … … 2375 2375 LogFlow(("PGMPhysWrite: %RGp %d\n", GCPhys, cbWrite)); 2376 2376 2377 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysWrite));2378 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysWriteBytes), cbWrite);2377 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysWrite)); 2378 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysWriteBytes), cbWrite); 2379 2379 2380 2380 pgmLock(pVM); … … 2636 2636 return VINF_SUCCESS; 2637 2637 2638 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysSimpleRead));2639 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysSimpleReadBytes), cb);2638 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysSimpleRead)); 2639 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysSimpleReadBytes), cb); 2640 2640 2641 2641 /* Take the PGM lock here, because many called functions take the lock for a very short period. That's counter-productive … … 2726 2726 return VINF_SUCCESS; 2727 2727 2728 STAM_COUNTER_INC(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysSimpleWrite));2729 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_ MID_Z(Stat,PhysSimpleWriteBytes), cb);2728 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysSimpleWrite)); 2729 STAM_COUNTER_ADD(&pVM->pgm.s.CTX_SUFF(pStats)->CTX_MID_Z(Stat,PhysSimpleWriteBytes), cb); 2730 2730 2731 2731 /* map the 1st page */ -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r31066 r31123 419 419 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 420 420 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 421 STAM_COUNTER_INC(&(pVCpu->pgm.s. StatRZGuestCR3WriteConflict));421 STAM_COUNTER_INC(&(pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestCR3WriteConflict)); 422 422 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw)); 423 423 break; … … 450 450 { 451 451 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 452 STAM_COUNTER_INC(&(pVCpu->pgm.s. StatRZGuestCR3WriteConflict));452 STAM_COUNTER_INC(&(pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestCR3WriteConflict)); 453 453 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 454 454 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); … … 497 497 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 498 498 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 499 STAM_COUNTER_INC(&(pVCpu->pgm.s. StatRZGuestCR3WriteConflict));499 STAM_COUNTER_INC(&(pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestCR3WriteConflict)); 500 500 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw=%#x!\n", iShw)); 501 501 break; … … 534 534 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 535 535 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 536 STAM_COUNTER_INC(&(pVCpu->pgm.s. StatRZGuestCR3WriteConflict));536 STAM_COUNTER_INC(&(pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestCR3WriteConflict)); 537 537 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); 538 538 break; … … 574 574 { 575 575 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 576 STAM_COUNTER_INC(&(pVCpu->pgm.s. StatRZGuestCR3WriteConflict));576 STAM_COUNTER_INC(&(pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestCR3WriteConflict)); 577 577 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 578 578 LogFlow(("pgmPoolMonitorChainChanging: Detected pdpt conflict at iShw=%#x!\n", iShw)); … … 605 605 { 606 606 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 607 STAM_COUNTER_INC(&(pVCpu->pgm.s. StatRZGuestCR3WriteConflict));607 STAM_COUNTER_INC(&(pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZGuestCR3WriteConflict)); 608 608 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 609 609 LogFlow(("pgmPoolMonitorChainChanging: Detected conflict at iShw2=%#x!\n", iShw2)); … … 3797 3797 paPhysExts[iPhysExt].aidx[2] = iShwPT; 3798 3798 paPhysExts[iPhysExt].apte[2] = iPte; 3799 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackAliasedMany);3799 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackAliasedMany); 3800 3800 LogFlow(("pgmPoolTrackPhysExtInsert: %d:{,,%d pte %d}\n", iPhysExt, iShwPT, iPte)); 3801 3801 return PGMPOOL_TD_MAKE(PGMPOOL_TD_CREFS_PHYSEXT, iPhysExt); … … 3813 3813 paPhysExts[iPhysExt].aidx[i] = iShwPT; 3814 3814 paPhysExts[iPhysExt].apte[i] = iPte; 3815 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackAliasedMany);3815 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackAliasedMany); 3816 3816 LogFlow(("pgmPoolTrackPhysExtInsert: %d:{%d pte %d} i=%d cMax=%d\n", iPhysExt, iShwPT, iPte, i, cMax)); 3817 3817 return PGMPOOL_TD_MAKE(PGMPOOL_TD_CREFS_PHYSEXT, iPhysExtStart); … … 3819 3819 if (!--cMax) 3820 3820 { 3821 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackOverflows);3821 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackOverflows); 3822 3822 pgmPoolTrackPhysExtFreeList(pVM, iPhysExtStart); 3823 3823 LogFlow(("pgmPoolTrackPhysExtInsert: overflow (1) iShwPT=%d\n", iShwPT)); … … 3830 3830 if (!pNew) 3831 3831 { 3832 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackNoExtentsLeft);3832 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackNoExtentsLeft); 3833 3833 pgmPoolTrackPhysExtFreeList(pVM, iPhysExtStart); 3834 3834 LogFlow(("pgmPoolTrackPhysExtInsert: pgmPoolTrackPhysExtAlloc failed iShwPT=%d\n", iShwPT)); … … 3868 3868 { 3869 3869 LogFlow(("pgmPoolTrackPhysExtAddref: new extent: %d:{%d, %d}\n", iPhysExt, PGMPOOL_TD_GET_IDX(u16), iShwPT)); 3870 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackAliased);3870 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackAliased); 3871 3871 pPhysExt->aidx[0] = PGMPOOL_TD_GET_IDX(u16); 3872 3872 pPhysExt->apte[0] = PGM_PAGE_GET_PTE_INDEX(pPhysPage); … … 3886 3886 } 3887 3887 else 3888 STAM_COUNTER_INC(&pVM->pgm.s. StatTrackAliasedLots);3888 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatTrackAliasedLots); 3889 3889 pgmUnlock(pVM); 3890 3890 return u16; -
trunk/src/VBox/VMM/VMMR0/PGMR0.cpp
r30889 r31123 224 224 { 225 225 if (uErr & X86_TRAP_PF_RW) 226 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSNotPresentWrite);226 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSNotPresentWrite); 227 227 else 228 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSNotPresentRead);228 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSNotPresentRead); 229 229 } 230 230 else if (uErr & X86_TRAP_PF_RW) 231 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSWrite);231 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSWrite); 232 232 else if (uErr & X86_TRAP_PF_RSVD) 233 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSReserved);233 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSReserved); 234 234 else if (uErr & X86_TRAP_PF_ID) 235 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSNXE);235 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSNXE); 236 236 else 237 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eUSRead);237 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eUSRead); 238 238 } 239 239 else … … 242 242 { 243 243 if (uErr & X86_TRAP_PF_RW) 244 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVNotPresentWrite);244 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVNotPresentWrite); 245 245 else 246 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVNotPresentRead);246 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVNotPresentRead); 247 247 } 248 248 else if (uErr & X86_TRAP_PF_RW) 249 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVWrite);249 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVWrite); 250 250 else if (uErr & X86_TRAP_PF_ID) 251 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSNXE);251 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSNXE); 252 252 else if (uErr & X86_TRAP_PF_RSVD) 253 STAM_COUNTER_INC(&pVCpu->pgm.s. StatRZTrap0eSVReserved);253 STAM_COUNTER_INC(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eSVReserved); 254 254 } 255 255 #endif … … 304 304 305 305 STAM_STATS({ if (!pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution)) 306 pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s. StatRZTrap0eTime2Misc; });307 STAM_PROFILE_STOP_EX(&pVCpu->pgm.s. StatRZTrap0e, pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a);306 pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution) = &pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0eTime2Misc; }); 307 STAM_PROFILE_STOP_EX(&pVCpu->pgm.s.CTX_SUFF(pStats)->StatRZTrap0e, pVCpu->pgm.s.CTX_SUFF(pStatTrap0eAttribution), a); 308 308 return rc; 309 309 } -
trunk/src/VBox/VMM/testcase/tstVMStructRC.cpp
r30572 r31123 523 523 GEN_CHECK_OFF(PGMCPU, cGuestModeChanges); 524 524 #ifdef VBOX_WITH_STATISTICS 525 GEN_CHECK_OFF(PGMCPU, pStatsR0); 525 526 GEN_CHECK_OFF(PGMCPU, pStatTrap0eAttributionR0); 527 GEN_CHECK_OFF(PGMCPU, pStatsRC); 526 528 GEN_CHECK_OFF(PGMCPU, pStatTrap0eAttributionRC); 527 GEN_CHECK_OFF(PGMCPU, StatSyncPtPD); 528 GEN_CHECK_OFF(PGMCPU, StatR3Prefetch); 529 GEN_CHECK_OFF(PGMCPU, pStatsR3); 529 530 #endif 530 531 GEN_CHECK_OFF(PGM, offVM); … … 612 613 GEN_CHECK_OFF(PGM, cReadLockedPages); 613 614 GEN_CHECK_OFF(PGM, cRelocations); 615 #ifdef VBOX_WITH_STATISTICS 616 GEN_CHECK_OFF(PGMCPU, pStatsR0); 617 GEN_CHECK_OFF(PGMCPU, pStatsRC); 618 GEN_CHECK_OFF(PGMCPU, pStatsR3); 619 #endif 614 620 615 621 GEN_CHECK_SIZE(PGMMAPPING); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r30217 r31123 339 339 CHECK_MEMBER_ALIGNMENT(PGMCPU, DisState, 8); 340 340 CHECK_MEMBER_ALIGNMENT(PGMCPU, cPoolAccessHandler, 8); 341 #ifdef VBOX_WITH_STATISTICS342 CHECK_MEMBER_ALIGNMENT(PGMCPU, StatSyncPtPD, 8);343 CHECK_MEMBER_ALIGNMENT(PGMCPU, StatR3Prefetch, 8);344 #endif345 341 CHECK_MEMBER_ALIGNMENT(PGMPOOLPAGE, idx, sizeof(uint16_t)); 346 342 CHECK_MEMBER_ALIGNMENT(PGMPOOLPAGE, pvPageR3, sizeof(RTHCPTR));
Note:
See TracChangeset
for help on using the changeset viewer.