Changeset 61570 in vbox for trunk/src/VBox
- Timestamp:
- Jun 8, 2016 10:55:10 AM (9 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r61392 r61570 899 899 * Register info handlers and registers with the debugger facility. 900 900 */ 901 DBGFR3InfoRegisterInternal(pVM, "cpum", "Displays the all the cpu states.", &cpumR3InfoAll); 902 DBGFR3InfoRegisterInternal(pVM, "cpumguest", "Displays the guest cpu state.", &cpumR3InfoGuest); 903 DBGFR3InfoRegisterInternal(pVM, "cpumhyper", "Displays the hypervisor cpu state.", &cpumR3InfoHyper); 904 DBGFR3InfoRegisterInternal(pVM, "cpumhost", "Displays the host cpu state.", &cpumR3InfoHost); 905 DBGFR3InfoRegisterInternal(pVM, "cpuid", "Displays the guest cpuid leaves.", &cpumR3CpuIdInfo); 906 DBGFR3InfoRegisterInternal(pVM, "cpumguestinstr", "Displays the current guest instruction.", &cpumR3InfoGuestInstr); 901 DBGFR3InfoRegisterInternalEx(pVM, "cpum", "Displays the all the cpu states.", 902 &cpumR3InfoAll, DBGFINFO_FLAGS_ALL_EMTS); 903 DBGFR3InfoRegisterInternalEx(pVM, "cpumguest", "Displays the guest cpu state.", 904 &cpumR3InfoGuest, DBGFINFO_FLAGS_ALL_EMTS); 905 DBGFR3InfoRegisterInternalEx(pVM, "cpumhyper", "Displays the hypervisor cpu state.", 906 &cpumR3InfoHyper, DBGFINFO_FLAGS_ALL_EMTS); 907 DBGFR3InfoRegisterInternalEx(pVM, "cpumhost", "Displays the host cpu state.", 908 &cpumR3InfoHost, DBGFINFO_FLAGS_ALL_EMTS); 909 DBGFR3InfoRegisterInternalEx(pVM, "cpumguestinstr", "Displays the current guest instruction.", 910 &cpumR3InfoGuestInstr, DBGFINFO_FLAGS_ALL_EMTS); 911 DBGFR3InfoRegisterInternal( pVM, "cpuid", "Displays the guest cpuid leaves.", &cpumR3CpuIdInfo); 907 912 908 913 rc = cpumR3DbgInit(pVM); … … 2070 2075 cpumR3InfoParseArg(pszArgs, &enmType, &pszComment); 2071 2076 2072 /* @todo SMP support! */2073 2077 PVMCPU pVCpu = VMMGetCpu(pVM); 2074 2078 if (!pVCpu) … … 2093 2097 NOREF(pszArgs); 2094 2098 2095 /** @todo SMP support! */2096 2099 PVMCPU pVCpu = VMMGetCpu(pVM); 2097 2100 if (!pVCpu) … … 2114 2117 static DECLCALLBACK(void) cpumR3InfoHyper(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs) 2115 2118 { 2119 PVMCPU pVCpu = VMMGetCpu(pVM); 2120 if (!pVCpu) 2121 pVCpu = &pVM->aCpus[0]; 2122 2116 2123 CPUMDUMPTYPE enmType; 2117 2124 const char *pszComment; 2118 /* @todo SMP */2119 PVMCPU pVCpu = &pVM->aCpus[0];2120 2121 2125 cpumR3InfoParseArg(pszArgs, &enmType, &pszComment); 2122 2126 pHlp->pfnPrintf(pHlp, "Hypervisor CPUM state: %s\n", pszComment); … … 2140 2144 pHlp->pfnPrintf(pHlp, "Host CPUM state: %s\n", pszComment); 2141 2145 2146 PVMCPU pVCpu = VMMGetCpu(pVM); 2147 if (!pVCpu) 2148 pVCpu = &pVM->aCpus[0]; 2149 PCPUMHOSTCTX pCtx = &pVCpu->cpum.s.Host; 2150 2142 2151 /* 2143 2152 * Format the EFLAGS. 2144 2153 */ 2145 /* @todo SMP */2146 PCPUMHOSTCTX pCtx = &pVM->aCpus[0].cpum.s.Host;2147 2154 #if HC_ARCH_BITS == 32 2148 2155 uint32_t efl = pCtx->eflags.u32; -
trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp
r58126 r61570 231 231 AssertReturn(*pszName, VERR_INVALID_PARAMETER); 232 232 AssertPtrReturn(pszDesc, VERR_INVALID_POINTER); 233 AssertMsgReturn(!(fFlags & ~(DBGFINFO_FLAGS_RUN_ON_EMT)), ("fFlags=%#x\n", fFlags), VERR_INVALID_PARAMETER); 233 AssertMsgReturn(!(fFlags & ~(DBGFINFO_FLAGS_RUN_ON_EMT | DBGFINFO_FLAGS_ALL_EMTS)), 234 ("fFlags=%#x\n", fFlags), VERR_INVALID_FLAGS); 234 235 235 236 /* … … 668 669 669 670 /** 670 * Worker for DBGFR3Info and DBGFR3InfoEx.671 * Worker for DBGFR3InfoEx. 671 672 * 672 673 * @returns VBox status code. … … 693 694 else 694 695 pHlp = &g_dbgfR3InfoLogHlp; 696 Assert(idCpu == NIL_VMCPUID || idCpu < pUVM->cCpus); /* if not nil, we're on that EMT already. */ 695 697 696 698 /* … … 710 712 * Found it. 711 713 */ 714 VMCPUID idDstCpu = NIL_VMCPUID; 715 if ((pInfo->fFlags & (DBGFINFO_FLAGS_RUN_ON_EMT | DBGFINFO_FLAGS_ALL_EMTS)) && idCpu == NIL_VMCPUID) 716 idDstCpu = pInfo->fFlags & DBGFINFO_FLAGS_ALL_EMTS ? VMCPUID_ALL : VMCPUID_ANY; 717 712 718 rc = VINF_SUCCESS; 713 719 switch (pInfo->enmType) 714 720 { 715 721 case DBGFINFOTYPE_DEV: 716 if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 717 rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)pInfo->u.Dev.pfnHandler, 3, pInfo->u.Dev.pDevIns, pHlp, pszArgs); 722 if (idDstCpu != NIL_VMCPUID) 723 rc = VMR3ReqPriorityCallWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Dev.pfnHandler, 3, 724 pInfo->u.Dev.pDevIns, pHlp, pszArgs); 718 725 else 719 726 pInfo->u.Dev.pfnHandler(pInfo->u.Dev.pDevIns, pHlp, pszArgs); … … 721 728 722 729 case DBGFINFOTYPE_DRV: 723 if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 724 rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)pInfo->u.Drv.pfnHandler, 3, pInfo->u.Drv.pDrvIns, pHlp, pszArgs); 730 if (idDstCpu != NIL_VMCPUID) 731 rc = VMR3ReqPriorityCallWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Drv.pfnHandler, 3, 732 pInfo->u.Drv.pDrvIns, pHlp, pszArgs); 725 733 else 726 734 pInfo->u.Drv.pfnHandler(pInfo->u.Drv.pDrvIns, pHlp, pszArgs); … … 730 738 if (RT_VALID_PTR(pUVM->pVM)) 731 739 { 732 if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 733 rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)pInfo->u.Int.pfnHandler, 3, pUVM->pVM, pHlp, pszArgs); 740 if (idDstCpu != NIL_VMCPUID) 741 rc = VMR3ReqPriorityCallWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Int.pfnHandler, 3, 742 pUVM->pVM, pHlp, pszArgs); 734 743 else 735 744 pInfo->u.Int.pfnHandler(pUVM->pVM, pHlp, pszArgs); … … 740 749 741 750 case DBGFINFOTYPE_EXT: 742 if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 743 rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)pInfo->u.Ext.pfnHandler, 3, pInfo->u.Ext.pvUser, pHlp, pszArgs); 751 if (idDstCpu != NIL_VMCPUID) 752 rc = VMR3ReqPriorityCallWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Ext.pfnHandler, 3, 753 pInfo->u.Ext.pvUser, pHlp, pszArgs); 744 754 else 745 755 pInfo->u.Ext.pfnHandler(pInfo->u.Ext.pvUser, pHlp, pszArgs); … … 749 759 AssertMsgFailedReturn(("Invalid info type enmType=%d\n", pInfo->enmType), VERR_IPE_NOT_REACHED_DEFAULT_CASE); 750 760 } 761 751 762 int rc2 = RTCritSectRwLeaveShared(&pUVM->dbgf.s.CritSect); 752 763 AssertRC(rc2); … … 760 771 return rc; 761 772 } 773 762 774 763 775 /** … … 772 784 VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 773 785 { 774 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 775 return dbgfR3Info(pUVM, VMCPUID_ANY, pszName, pszArgs, pHlp); 786 return DBGFR3InfoEx(pUVM, NIL_VMCPUID, pszName, pszArgs, pHlp); 776 787 } 777 788 … … 783 794 * @param pUVM The user mode VM handle. 784 795 * @param idCpu The CPU to exectue the request on. Pass NIL_VMCPUID 785 * to not involve any EMT .796 * to not involve any EMT unless necessary. 786 797 * @param pszName The identifier of the info to display. 787 798 * @param pszArgs Arguments to the info handler. … … 790 801 VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 791 802 { 803 /* 804 * Some input validation. 805 */ 792 806 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 807 AssertReturn( idCpu != VMCPUID_ANY_QUEUE 808 && idCpu != VMCPUID_ALL 809 && idCpu != VMCPUID_ALL_REVERSE, VERR_INVALID_PARAMETER); 810 811 /* 812 * Run on any specific EMT? 813 */ 793 814 if (idCpu == NIL_VMCPUID) 794 return dbgfR3Info(pUVM, VMCPUID_ANY, pszName, pszArgs, pHlp);815 return dbgfR3Info(pUVM, NIL_VMCPUID, pszName, pszArgs, pHlp); 795 816 return VMR3ReqPriorityCallWaitU(pUVM, idCpu, 796 817 (PFNRT)dbgfR3Info, 5, pUVM, idCpu, pszName, pszArgs, pHlp); … … 808 829 VMMR3DECL(int) DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs) 809 830 { 810 return DBGFR3Info (pUVM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp);831 return DBGFR3InfoEx(pUVM, NIL_VMCPUID, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp); 811 832 } 812 833 … … 822 843 VMMR3DECL(int) DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs) 823 844 { 824 return DBGFR3Info (pUVM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp);845 return DBGFR3InfoEx(pUVM, NIL_VMCPUID, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp); 825 846 } 826 847 … … 877 898 { 878 899 pHlp->pfnPrintf(pHlp, pszSepFmt, pInfo->szName); 900 901 VMCPUID idDstCpu = NIL_VMCPUID; 902 if (pInfo->fFlags & (DBGFINFO_FLAGS_RUN_ON_EMT | DBGFINFO_FLAGS_ALL_EMTS)) 903 idDstCpu = pInfo->fFlags & DBGFINFO_FLAGS_ALL_EMTS ? VMCPUID_ALL : VMCPUID_ANY; 904 879 905 rc = VINF_SUCCESS; 880 906 switch (pInfo->enmType) 881 907 { 882 908 case DBGFINFOTYPE_DEV: 883 if ( pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)884 rc = VMR3Req CallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Dev.pfnHandler, 3,885 pInfo->u.Dev.pDevIns, pHlp, pszArgs);909 if (idDstCpu != NIL_VMCPUID) 910 rc = VMR3ReqPriorityCallVoidWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Dev.pfnHandler, 3, 911 pInfo->u.Dev.pDevIns, pHlp, pszArgs); 886 912 else 887 913 pInfo->u.Dev.pfnHandler(pInfo->u.Dev.pDevIns, pHlp, pszArgs); … … 889 915 890 916 case DBGFINFOTYPE_DRV: 891 if ( pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)892 rc = VMR3Req CallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Drv.pfnHandler, 3,893 pInfo->u.Drv.pDrvIns, pHlp, pszArgs);917 if (idDstCpu != NIL_VMCPUID) 918 rc = VMR3ReqPriorityCallVoidWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Drv.pfnHandler, 3, 919 pInfo->u.Drv.pDrvIns, pHlp, pszArgs); 894 920 else 895 921 pInfo->u.Drv.pfnHandler(pInfo->u.Drv.pDrvIns, pHlp, pszArgs); … … 897 923 898 924 case DBGFINFOTYPE_INT: 899 if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT) 900 rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Int.pfnHandler, 3, pVM, pHlp, pszArgs); 925 if (idDstCpu != NIL_VMCPUID) 926 rc = VMR3ReqPriorityCallVoidWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Int.pfnHandler, 3, 927 pVM, pHlp, pszArgs); 901 928 else 902 929 pInfo->u.Int.pfnHandler(pVM, pHlp, pszArgs); … … 904 931 905 932 case DBGFINFOTYPE_EXT: 906 if ( pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)907 rc = VMR3Req CallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Ext.pfnHandler, 3,908 pInfo->u.Ext.pvUser, pHlp, pszArgs);933 if (idDstCpu != NIL_VMCPUID) 934 rc = VMR3ReqPriorityCallVoidWaitU(pUVM, idDstCpu, (PFNRT)pInfo->u.Ext.pfnHandler, 3, 935 pInfo->u.Ext.pvUser, pHlp, pszArgs); 909 936 else 910 937 pInfo->u.Ext.pfnHandler(pInfo->u.Ext.pvUser, pHlp, pszArgs); -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r60401 r61570 1502 1502 * Info & statistics 1503 1503 */ 1504 DBGFR3InfoRegisterInternal(pVM, "mode", 1505 "Shows the current paging mode. " 1506 "Recognizes 'all', 'guest', 'shadow' and 'host' as arguments, defaulting to 'all' if nothing is given.", 1507 pgmR3InfoMode); 1504 DBGFR3InfoRegisterInternalEx(pVM, "mode", 1505 "Shows the current paging mode. " 1506 "Recognizes 'all', 'guest', 'shadow' and 'host' as arguments, defaulting to 'all' if nothing is given.", 1507 pgmR3InfoMode, 1508 DBGFINFO_FLAGS_ALL_EMTS); 1508 1509 DBGFR3InfoRegisterInternal(pVM, "pgmcr3", 1509 1510 "Dumps all the entries in the top level paging table. No arguments.", … … 2746 2747 } 2747 2748 2748 /** @todo SMP support! */ 2749 PVMCPU pVCpu = VMMGetCpu(pVM); 2750 if (!pVCpu) 2751 pVCpu = &pVM->aCpus[0]; 2752 2753 2749 2754 /* print info. */ 2750 2755 if (fGuest) 2751 pHlp->pfnPrintf(pHlp, "Guest paging mode : %s (changed %RU64 times), A20 %s (changed %RU64 times)\n",2752 PGMGetModeName(pVM->aCpus[0].pgm.s.enmGuestMode), pVM->aCpus[0].pgm.s.cGuestModeChanges.c,2753 pV M->aCpus[0].pgm.s.fA20Enabled ? "enabled" : "disabled", pVM->aCpus[0].pgm.s.cA20Changes.c);2756 pHlp->pfnPrintf(pHlp, "Guest paging mode (VCPU #%u): %s (changed %RU64 times), A20 %s (changed %RU64 times)\n", 2757 pVCpu->idCpu, PGMGetModeName(pVCpu->pgm.s.enmGuestMode), pVCpu->pgm.s.cGuestModeChanges.c, 2758 pVCpu->pgm.s.fA20Enabled ? "enabled" : "disabled", pVCpu->pgm.s.cA20Changes.c); 2754 2759 if (fShadow) 2755 pHlp->pfnPrintf(pHlp, "Shadow paging mode : %s\n", PGMGetModeName(pVM->aCpus[0].pgm.s.enmShadowMode));2760 pHlp->pfnPrintf(pHlp, "Shadow paging mode (VCPU #%u): %s\n", pVCpu->idCpu, PGMGetModeName(pVCpu->pgm.s.enmShadowMode)); 2756 2761 if (fHost) 2757 2762 { … … 2772 2777 default: psz = "unknown"; break; 2773 2778 } 2774 pHlp->pfnPrintf(pHlp, "Host paging mode: %s\n", psz);2779 pHlp->pfnPrintf(pHlp, "Host paging mode: %s\n", psz); 2775 2780 } 2776 2781 } -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r61397 r61570 2313 2313 if (enmVMState != VMSTATE_GURU_MEDITATION) 2314 2314 { 2315 /** @todo SMP support? */2316 2315 /** @todo make the state dumping at VMR3PowerOff optional. */ 2317 2316 bool fOldBuffered = RTLogRelSetBuffering(true /*fBuffered*/); 2318 2317 RTLogRelPrintf("****************** Guest state at power off ******************\n"); 2319 DBGFR3Info (pVM->pUVM, "cpumguest", "verbose", DBGFR3InfoLogRelHlp());2318 DBGFR3InfoEx(pVM->pUVM, 0, "cpumguest", "verbose", DBGFR3InfoLogRelHlp()); 2320 2319 RTLogRelPrintf("***\n"); 2321 DBGFR3Info (pVM->pUVM, "mode", NULL, DBGFR3InfoLogRelHlp());2320 DBGFR3InfoEx(pVM->pUVM, 0, "mode", NULL, DBGFR3InfoLogRelHlp()); 2322 2321 RTLogRelPrintf("***\n"); 2323 2322 DBGFR3Info(pVM->pUVM, "activetimers", NULL, DBGFR3InfoLogRelHlp()); … … 2325 2324 DBGFR3Info(pVM->pUVM, "gdt", NULL, DBGFR3InfoLogRelHlp()); 2326 2325 /** @todo dump guest call stack. */ 2327 #if 1 // "temporary" while debugging #15892328 RTLogRelPrintf("***\n");2329 uint32_t esp = CPUMGetGuestESP(pVCpu);2330 if ( CPUMGetGuestSS(pVCpu) == 02331 && esp < _64K)2332 {2333 uint8_t abBuf[PAGE_SIZE];2334 RTLogRelPrintf("***\n"2335 "ss:sp=0000:%04x ", esp);2336 uint32_t Start = esp & ~(uint32_t)63;2337 int rc = PGMPhysSimpleReadGCPhys(pVM, abBuf, Start, 0x100);2338 if (RT_SUCCESS(rc))2339 RTLogRelPrintf("0000:%04x TO 0000:%04x:\n"2340 "%.*Rhxd\n",2341 Start, Start + 0x100 - 1,2342 0x100, abBuf);2343 else2344 RTLogRelPrintf("rc=%Rrc\n", rc);2345 2346 /* grub ... */2347 if (esp < 0x2000 && esp > 0x1fc0)2348 {2349 rc = PGMPhysSimpleReadGCPhys(pVM, abBuf, 0x8000, 0x800);2350 if (RT_SUCCESS(rc))2351 RTLogRelPrintf("0000:8000 TO 0000:87ff:\n"2352 "%.*Rhxd\n",2353 0x800, abBuf);2354 }2355 /* microsoft cdrom hang ... */2356 if (true)2357 {2358 rc = PGMPhysSimpleReadGCPhys(pVM, abBuf, 0x8000, 0x200);2359 if (RT_SUCCESS(rc))2360 RTLogRelPrintf("2000:0000 TO 2000:01ff:\n"2361 "%.*Rhxd\n",2362 0x200, abBuf);2363 }2364 }2365 #endif2366 2326 RTLogRelSetBuffering(fOldBuffered); 2367 2327 RTLogRelPrintf("************** End of Guest state at power off ***************\n");
Note:
See TracChangeset
for help on using the changeset viewer.