- Timestamp:
- Sep 2, 2009 1:53:39 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r22480 r22716 584 584 #include <VBox/em.h> 585 585 #include <VBox/stam.h> 586 #include <VBox/rem.h>587 #include <VBox/dbgf.h>588 586 #include <VBox/rem.h> 589 587 #include <VBox/selm.h> -
trunk/src/VBox/VMM/PGMPool.cpp
r22713 r22716 110 110 #include <iprt/asm.h> 111 111 #include <iprt/string.h> 112 #include <VBox/dbg.h> 112 113 113 114 … … 118 119 static DECLCALLBACK(int) pgmR3PoolAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser); 119 120 #endif /* PGMPOOL_WITH_MONITORING */ 120 121 #ifdef VBOX_WITH_DEBUGGER 122 static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 123 #endif 124 125 #ifdef VBOX_WITH_DEBUGGER 126 /** Command descriptors. */ 127 static const DBGCCMD g_aCmds[] = 128 { 129 /* pszCmd, cArgsMin, cArgsMax, paArgDesc, cArgDescs, pResultDesc, fFlags, pfnHandler pszSyntax, ....pszDescription */ 130 { "pgmpoolcheck", 0, 0, NULL, 0, NULL, 0, pgmR3PoolCmdCheck, "", "Check the pgm pool pages." }, 131 }; 132 #endif 121 133 122 134 /** … … 379 391 #endif /* VBOX_WITH_STATISTICS */ 380 392 393 #ifdef VBOX_WITH_DEBUGGER 394 /* 395 * Debugger commands. 396 */ 397 static bool s_fRegisteredCmds = false; 398 if (!s_fRegisteredCmds) 399 { 400 int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds)); 401 if (RT_SUCCESS(rc)) 402 s_fRegisteredCmds = true; 403 } 404 #endif 405 381 406 return VINF_SUCCESS; 382 407 } … … 588 613 #endif /* PGMPOOL_WITH_MONITORING */ 589 614 615 #ifdef VBOX_WITH_DEBUGGER 616 /** 617 * The '.pgmpoolcheck' command. 618 * 619 * @returns VBox status. 620 * @param pCmd Pointer to the command descriptor (as registered). 621 * @param pCmdHlp Pointer to command helper functions. 622 * @param pVM Pointer to the current VM (if any). 623 * @param paArgs Pointer to (readonly) array of arguments. 624 * @param cArgs Number of arguments in the array. 625 */ 626 static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 627 { 628 /* 629 * Validate input. 630 */ 631 if (!pVM) 632 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n"); 633 634 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 635 636 for (unsigned i = 0; i < pPool->cCurPages; i++) 637 { 638 PPGMPOOLPAGE pPage = &pPool->aPages[i]; 639 640 /* Todo: cover other paging modes too. */ 641 if (pPage->enmKind == PGMPOOLKIND_PAE_PT_FOR_PAE_PT) 642 { 643 PX86PTPAE pShwPT = (PX86PTPAE)PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pPage); 644 PX86PTPAE pGstPT; 645 int rc = PGM_GCPHYS_2_PTR(pPool->CTX_SUFF(pVM), pPage->GCPhys, &pGstPT); AssertReleaseRC(rc); 646 647 for (unsigned j = 0; j < RT_ELEMENTS(pShwPT->a); j++) 648 { 649 if (pShwPT->a[j].n.u1Present) 650 { 651 RTHCPHYS HCPhys = -1; 652 rc = PGMPhysGCPhys2HCPhys(pPool->CTX_SUFF(pVM), pGstPT->a[j].u & X86_PTE_PAE_PG_MASK, &HCPhys); 653 if ( rc != VINF_SUCCESS 654 || (pShwPT->a[j].u & X86_PTE_PAE_PG_MASK) != HCPhys) 655 { 656 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Pool check: rc=%d idx=%d guest %RX64 shw=%RX64 vs %RHp\n", rc, j, pGstPT->a[j].u, pShwPT->a[j].u, HCPhys); 657 } 658 else 659 if ( pShwPT->a[j].n.u1Write 660 # ifdef PGMPOOL_WITH_OPTIMIZED_DIRTY_PT 661 && !pPage->fDirty 662 # endif 663 ) 664 { 665 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Pool check r/w: rc=%d idx=%d guest %RX64 shw=%RX64 vs %RHp\n", rc, j, pGstPT->a[j].u, pShwPT->a[j].u, HCPhys); 666 } 667 } 668 } 669 } 670 } 671 return VINF_SUCCESS; 672 } 673 #endif
Note:
See TracChangeset
for help on using the changeset viewer.