- Timestamp:
- Aug 26, 2010 12:43:18 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pgm.h
r31983 r31989 555 555 VMMR3DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit); 556 556 VMMR3DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit); 557 VMMR3DECL(int) PGMR3DumpHierarchyHC(PVM pVM, uint64_t cr3, uint64_t cr4, bool fLongMode, unsigned cMaxDepth, PCDBGFINFOHLP pHlp); 558 VMMR3_INT_DECL(int) PGMR3DumpHierarchyHCEx(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp); 559 VMMR3DECL(int) PGMR3DumpHierarchyGC(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCPHYS PhysSearch); 560 VMMR3_INT_DECL(int) PGMR3DumpHierarchyGCEx(PVM pVM, uint64_t cr3, uint32_t fFlags, RTGCPTR FirstAddr, RTGCPTR LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp); 557 VMMR3_INT_DECL(int) PGMR3DumpHierarchyShw(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp); 558 VMMR3_INT_DECL(int) PGMR3DumpHierarchyGst(PVM pVM, uint64_t cr3, uint32_t fFlags, RTGCPTR FirstAddr, RTGCPTR LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp); 561 559 562 560 -
trunk/src/VBox/VMM/DBGFMem.cpp
r31987 r31989 613 613 int rc; 614 614 if (fFlags & DBGFPGDMP_FLAGS_SHADOW) 615 rc = PGMR3DumpHierarchy HCEx(pVM, cr3, fFlags, *pu64FirstAddr, *pu64LastAddr, cMaxDepth, pHlp);615 rc = PGMR3DumpHierarchyShw(pVM, cr3, fFlags, *pu64FirstAddr, *pu64LastAddr, cMaxDepth, pHlp); 616 616 else 617 rc = PGMR3DumpHierarchyG CEx(pVM, cr3, fFlags, *pu64FirstAddr, *pu64LastAddr, cMaxDepth, pHlp);617 rc = PGMR3DumpHierarchyGst(pVM, cr3, fFlags, *pu64FirstAddr, *pu64LastAddr, cMaxDepth, pHlp); 618 618 return rc; 619 619 } -
trunk/src/VBox/VMM/PGMDbg.cpp
r31987 r31989 1638 1638 * @internal 1639 1639 */ 1640 VMMR3_INT_DECL(int) PGMR3DumpHierarchy HCEx(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr,1641 1640 VMMR3_INT_DECL(int) PGMR3DumpHierarchyShw(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr, 1641 uint32_t cMaxDepth, PCDBGFINFOHLP pHlp) 1642 1642 { 1643 1643 /* Minimal validation as we're only supposed to service DBGF. */ … … 1681 1681 return DBGFR3PagingDumpEx(pVM, pVCpu->idCpu, fFlags, cr3, 0, fLongMode ? UINT64_MAX : UINT32_MAX, cMaxDepth, pHlp); 1682 1682 } 1683 1684 1685 ////// kill this code //////1686 1687 /**1688 * Dumps a 32-bit shadow page table.1689 *1690 * @returns VBox status code (VINF_SUCCESS).1691 * @param pVM The VM handle.1692 * @param pPT Pointer to the page table.1693 * @param u32Address The virtual address this table starts at.1694 * @param PhysSearch Address to search for.1695 */1696 int pgmR3DumpHierarchyGC32BitPT(PVM pVM, PX86PT pPT, uint32_t u32Address, RTGCPHYS PhysSearch)1697 {1698 for (unsigned i = 0; i < RT_ELEMENTS(pPT->a); i++)1699 {1700 X86PTE Pte = pPT->a[i];1701 if (Pte.n.u1Present)1702 {1703 Log(( /*P R S A D G WT CD AT NX 4M a m d */1704 "%08x 1 | P %c %c %c %c %c %s %s %s .. 4K %c%c%c %08x\n",1705 u32Address + (i << X86_PT_SHIFT),1706 Pte.n.u1Write ? 'W' : 'R',1707 Pte.n.u1User ? 'U' : 'S',1708 Pte.n.u1Accessed ? 'A' : '-',1709 Pte.n.u1Dirty ? 'D' : '-',1710 Pte.n.u1Global ? 'G' : '-',1711 Pte.n.u1WriteThru ? "WT" : "--",1712 Pte.n.u1CacheDisable? "CD" : "--",1713 Pte.n.u1PAT ? "AT" : "--",1714 Pte.u & PGM_PTFLAGS_TRACK_DIRTY ? 'd' : '-',1715 Pte.u & RT_BIT(10) ? '1' : '0',1716 Pte.u & PGM_PTFLAGS_CSAM_VALIDATED ? 'v' : '-',1717 Pte.u & X86_PDE_PG_MASK));1718 1719 if ((Pte.u & X86_PDE_PG_MASK) == PhysSearch)1720 {1721 uint64_t fPageShw = 0;1722 RTHCPHYS pPhysHC = 0;1723 1724 /** @todo SMP support!! */1725 PGMShwGetPage(&pVM->aCpus[0], (RTGCPTR)(u32Address + (i << X86_PT_SHIFT)), &fPageShw, &pPhysHC);1726 Log(("Found %RGp at %RGv -> flags=%llx\n", PhysSearch, (RTGCPTR)(u32Address + (i << X86_PT_SHIFT)), fPageShw));1727 }1728 }1729 }1730 return VINF_SUCCESS;1731 }1732 1733 1734 /**1735 * Dumps a 32-bit guest page directory and page tables.1736 *1737 * @returns VBox status code (VINF_SUCCESS).1738 * @param pVM The VM handle.1739 * @param cr3 The root of the hierarchy.1740 * @param cr4 The CR4, PSE is currently used.1741 * @param PhysSearch Address to search for.1742 * @deprecated Use DBGFR3PagingDumpEx.1743 */1744 VMMR3DECL(int) PGMR3DumpHierarchyGC(PVM pVM, uint64_t cr3, uint64_t cr4, RTGCPHYS PhysSearch)1745 {1746 bool fLongMode = false;1747 const unsigned cch = fLongMode ? 16 : 8; NOREF(cch);1748 PX86PD pPD = 0;1749 PGMPAGEMAPLOCK LockCr3;1750 1751 int rc = PGMPhysGCPhys2CCPtrReadOnly(pVM, cr3 & X86_CR3_PAGE_MASK, (const void **)&pPD, &LockCr3);1752 if ( RT_FAILURE(rc)1753 || !pPD)1754 {1755 Log(("Page directory at %#x was not found in the page pool!\n", cr3 & X86_CR3_PAGE_MASK));1756 return VERR_INVALID_PARAMETER;1757 }1758 1759 Log(("cr3=%08x cr4=%08x%s\n"1760 "%-*s P - Present\n"1761 "%-*s | R/W - Read (0) / Write (1)\n"1762 "%-*s | | U/S - User (1) / Supervisor (0)\n"1763 "%-*s | | | A - Accessed\n"1764 "%-*s | | | | D - Dirty\n"1765 "%-*s | | | | | G - Global\n"1766 "%-*s | | | | | | WT - Write thru\n"1767 "%-*s | | | | | | | CD - Cache disable\n"1768 "%-*s | | | | | | | | AT - Attribute table (PAT)\n"1769 "%-*s | | | | | | | | | NX - No execute (K8)\n"1770 "%-*s | | | | | | | | | | 4K/4M/2M - Page size.\n"1771 "%-*s | | | | | | | | | | | AVL - a=allocated; m=mapping; d=track dirty;\n"1772 "%-*s | | | | | | | | | | | | p=permanent; v=validated;\n"1773 "%-*s Level | | | | | | | | | | | | Page\n"1774 /* xxxx n **** P R S A D G WT CD AT NX 4M AVL xxxxxxxxxxxxx1775 - W U - - - -- -- -- -- -- 010 */1776 , cr3, cr4, fLongMode ? " Long Mode" : "",1777 cch, "", cch, "", cch, "", cch, "", cch, "", cch, "", cch, "",1778 cch, "", cch, "", cch, "", cch, "", cch, "", cch, "", cch, "Address"));1779 1780 for (unsigned i = 0; i < RT_ELEMENTS(pPD->a); i++)1781 {1782 X86PDE Pde = pPD->a[i];1783 if (Pde.n.u1Present)1784 {1785 const uint32_t u32Address = i << X86_PD_SHIFT;1786 1787 if ((cr4 & X86_CR4_PSE) && Pde.b.u1Size)1788 Log(( /*P R S A D G WT CD AT NX 4M a m d */1789 "%08x 0 | P %c %c %c %c %c %s %s %s .. 4M %c%c%c %08x\n",1790 u32Address,1791 Pde.b.u1Write ? 'W' : 'R',1792 Pde.b.u1User ? 'U' : 'S',1793 Pde.b.u1Accessed ? 'A' : '-',1794 Pde.b.u1Dirty ? 'D' : '-',1795 Pde.b.u1Global ? 'G' : '-',1796 Pde.b.u1WriteThru ? "WT" : "--",1797 Pde.b.u1CacheDisable? "CD" : "--",1798 Pde.b.u1PAT ? "AT" : "--",1799 Pde.u & RT_BIT(9) ? '1' : '0',1800 Pde.u & RT_BIT(10) ? '1' : '0',1801 Pde.u & RT_BIT(11) ? '1' : '0',1802 pgmGstGet4MBPhysPage(&pVM->pgm.s, Pde)));1803 /** @todo PhysSearch */1804 else1805 {1806 Log(( /*P R S A D G WT CD AT NX 4M a m d */1807 "%08x 0 | P %c %c %c %c %c %s %s .. .. 4K %c%c%c %08x\n",1808 u32Address,1809 Pde.n.u1Write ? 'W' : 'R',1810 Pde.n.u1User ? 'U' : 'S',1811 Pde.n.u1Accessed ? 'A' : '-',1812 Pde.n.u1Reserved0 ? '?' : '.', /* ignored */1813 Pde.n.u1Reserved1 ? '?' : '.', /* ignored */1814 Pde.n.u1WriteThru ? "WT" : "--",1815 Pde.n.u1CacheDisable? "CD" : "--",1816 Pde.u & RT_BIT(9) ? '1' : '0',1817 Pde.u & RT_BIT(10) ? '1' : '0',1818 Pde.u & RT_BIT(11) ? '1' : '0',1819 Pde.u & X86_PDE_PG_MASK));1820 ////if (cMaxDepth >= 1)1821 {1822 /** @todo what about using the page pool for mapping PTs? */1823 RTGCPHYS GCPhys = Pde.u & X86_PDE_PG_MASK;1824 PX86PT pPT = NULL;1825 PGMPAGEMAPLOCK LockPT;1826 1827 rc = PGMPhysGCPhys2CCPtrReadOnly(pVM, GCPhys, (const void **)&pPT, &LockPT);1828 1829 int rc2 = VERR_INVALID_PARAMETER;1830 if (pPT)1831 rc2 = pgmR3DumpHierarchyGC32BitPT(pVM, pPT, u32Address, PhysSearch);1832 else1833 Log(("%08x error! Page table at %#x was not found in the page pool!\n", u32Address, GCPhys));1834 1835 if (rc == VINF_SUCCESS)1836 PGMPhysReleasePageMappingLock(pVM, &LockPT);1837 1838 if (rc2 < rc && RT_SUCCESS(rc))1839 rc = rc2;1840 }1841 }1842 }1843 }1844 PGMPhysReleasePageMappingLock(pVM, &LockCr3);1845 return rc;1846 }1847 1848 /////// end of to-be-killed code. ///////1849 1683 1850 1684 … … 2481 2315 * @internal 2482 2316 */ 2483 VMMR3_INT_DECL(int) PGMR3DumpHierarchyG CEx(PVM pVM, uint64_t cr3, uint32_t fFlags, RTGCPTR FirstAddr, RTGCPTR LastAddr,2484 2317 VMMR3_INT_DECL(int) PGMR3DumpHierarchyGst(PVM pVM, uint64_t cr3, uint32_t fFlags, RTGCPTR FirstAddr, RTGCPTR LastAddr, 2318 uint32_t cMaxDepth, PCDBGFINFOHLP pHlp) 2485 2319 { 2486 2320 /* Minimal validation as we're only supposed to service DBGF. */ -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r31947 r31989 3956 3956 # ifdef IN_RING3 3957 3957 PGMAssertHandlerAndFlagsInSync(pVM); 3958 PGMR3DumpHierarchyGC(pVM, cr3, cr4, GST_GET_PDE_GCPHYS(PdeSrc)); 3958 DBGFR3PagingDumpEx(pVM, pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE 3959 | DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3, 3960 0, 0, UINT64_MAX, 99, NULL); 3959 3961 # endif 3960 3962 AssertMsgFailed(("Out of sync (!P) PTE at %RGv! PteSrc=%#RX64 PteDst=%#RX64 pPTSrc=%RGv iPTSrc=%x PdeSrc=%x physpte=%RGp\n", -
trunk/src/VBox/VMM/testcase/tstMicro.cpp
r28800 r31989 255 255 return rc; 256 256 } 257 PGMR3DumpHierarchyHC(pVM, PGMGetHyperCR3(VMMGetCpu0(pVM)), X86_CR4_PSE, false, 4, NULL); 257 DBGFR3PagingDumpEx(pVM, 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE 258 | DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3, 259 0 /*cr3*/, 0 /*u64FirstAddr*/, UINT64_MAX /*u64LastAddr*/, 99 /*cMaxDepth*/, NULL); 258 260 259 261 #if 0
Note:
See TracChangeset
for help on using the changeset viewer.