Changeset 90487 in vbox for trunk/src/VBox/VMM/VMMR3/CPUM.cpp
- Timestamp:
- Aug 3, 2021 5:41:36 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r87773 r90487 4042 4042 pVCpu = pVM->apCpusR3[0]; 4043 4043 4044 /* 4045 * Figure out what to dump. 4046 */ 4047 /** @todo perhaps make this configurable through pszArgs, depending on how much 4048 * noise we wish to accept when nested hwvirt. isn't used. */ 4049 #define CPUMHWVIRTDUMP_NONE (0) 4050 #define CPUMHWVIRTDUMP_SVM RT_BIT(0) 4051 #define CPUMHWVIRTDUMP_VMX RT_BIT(1) 4052 #define CPUMHWVIRTDUMP_COMMON RT_BIT(2) 4053 #define CPUMHWVIRTDUMP_LAST CPUMHWVIRTDUMP_VMX 4054 4055 PCPUMCTX pCtx = &pVCpu->cpum.s.Guest; 4056 static const char *const s_aHwvirtModes[] = { "No/inactive", "SVM", "VMX", "Common" }; 4044 PCCPUMCTX pCtx = &pVCpu->cpum.s.Guest; 4057 4045 bool const fSvm = pVM->cpum.s.GuestFeatures.fSvm; 4058 4046 bool const fVmx = pVM->cpum.s.GuestFeatures.fVmx; 4059 uint8_t const idxHwvirtState = fSvm ? CPUMHWVIRTDUMP_SVM : (fVmx ? CPUMHWVIRTDUMP_VMX : CPUMHWVIRTDUMP_NONE); 4060 AssertCompile(CPUMHWVIRTDUMP_LAST <= RT_ELEMENTS(s_aHwvirtModes)); 4061 Assert(idxHwvirtState < RT_ELEMENTS(s_aHwvirtModes)); 4062 const char *pcszHwvirtMode = s_aHwvirtModes[idxHwvirtState]; 4063 uint32_t fDumpState = idxHwvirtState | CPUMHWVIRTDUMP_COMMON; 4064 4065 /* 4066 * Dump it. 4067 */ 4047 4068 4048 pHlp->pfnPrintf(pHlp, "VCPU[%u] hardware virtualization state:\n", pVCpu->idCpu); 4069 4070 if (fDumpState & CPUMHWVIRTDUMP_COMMON) 4071 pHlp->pfnPrintf(pHlp, "fLocalForcedActions = %#RX32\n", pCtx->hwvirt.fLocalForcedActions); 4072 4073 pHlp->pfnPrintf(pHlp, "%s hwvirt state%s\n", pcszHwvirtMode, (fDumpState & (CPUMHWVIRTDUMP_SVM | CPUMHWVIRTDUMP_VMX)) ? 4074 ":" : ""); 4075 if (fDumpState & CPUMHWVIRTDUMP_SVM) 4076 { 4049 pHlp->pfnPrintf(pHlp, "fLocalForcedActions = %#RX32\n", pCtx->hwvirt.fLocalForcedActions); 4050 pHlp->pfnPrintf(pHlp, "In nested-guest hwvirt mode = %RTbool\n", CPUMIsGuestInNestedHwvirtMode(pCtx)); 4051 4052 if (fSvm) 4053 { 4054 pHlp->pfnPrintf(pHlp, "SVM hwvirt state:\n"); 4077 4055 pHlp->pfnPrintf(pHlp, " fGif = %RTbool\n", pCtx->hwvirt.fGif); 4078 4056 … … 4094 4072 pHlp->pfnPrintf(pHlp, " uRax = %#RX64\n", pCtx->hwvirt.svm.HostState.uRax); 4095 4073 pHlp->pfnPrintf(pHlp, " rflags = %#RX64 %31s\n", pCtx->hwvirt.svm.HostState.rflags.u64, szEFlags); 4096 PC PUMSELREG pSel= &pCtx->hwvirt.svm.HostState.es;4074 PCCPUMSELREG pSelEs = &pCtx->hwvirt.svm.HostState.es; 4097 4075 pHlp->pfnPrintf(pHlp, " es = {%04x base=%016RX64 limit=%08x flags=%08x}\n", 4098 pSel ->Sel, pSel->u64Base, pSel->u32Limit, pSel->Attr.u);4099 pSel= &pCtx->hwvirt.svm.HostState.cs;4076 pSelEs->Sel, pSelEs->u64Base, pSelEs->u32Limit, pSelEs->Attr.u); 4077 PCCPUMSELREG pSelCs = &pCtx->hwvirt.svm.HostState.cs; 4100 4078 pHlp->pfnPrintf(pHlp, " cs = {%04x base=%016RX64 limit=%08x flags=%08x}\n", 4101 pSel ->Sel, pSel->u64Base, pSel->u32Limit, pSel->Attr.u);4102 pSel= &pCtx->hwvirt.svm.HostState.ss;4079 pSelCs->Sel, pSelCs->u64Base, pSelCs->u32Limit, pSelCs->Attr.u); 4080 PCCPUMSELREG pSelSs = &pCtx->hwvirt.svm.HostState.ss; 4103 4081 pHlp->pfnPrintf(pHlp, " ss = {%04x base=%016RX64 limit=%08x flags=%08x}\n", 4104 pSel ->Sel, pSel->u64Base, pSel->u32Limit, pSel->Attr.u);4105 pSel= &pCtx->hwvirt.svm.HostState.ds;4082 pSelSs->Sel, pSelSs->u64Base, pSelSs->u32Limit, pSelSs->Attr.u); 4083 PCCPUMSELREG pSelDs = &pCtx->hwvirt.svm.HostState.ds; 4106 4084 pHlp->pfnPrintf(pHlp, " ds = {%04x base=%016RX64 limit=%08x flags=%08x}\n", 4107 pSel ->Sel, pSel->u64Base, pSel->u32Limit, pSel->Attr.u);4085 pSelDs->Sel, pSelDs->u64Base, pSelDs->u32Limit, pSelDs->Attr.u); 4108 4086 pHlp->pfnPrintf(pHlp, " gdtr = %016RX64:%04x\n", pCtx->hwvirt.svm.HostState.gdtr.pGdt, 4109 4087 pCtx->hwvirt.svm.HostState.gdtr.cbGdt); … … 4118 4096 pHlp->pfnPrintf(pHlp, " pvIoBitmapR0 = %RKv\n", pCtx->hwvirt.svm.pvIoBitmapR0); 4119 4097 } 4120 4121 if (fDumpState & CPUMHWVIRTDUMP_VMX)4122 {4098 else if (fVmx) 4099 { 4100 pHlp->pfnPrintf(pHlp, "VMX hwvirt state:\n"); 4123 4101 pHlp->pfnPrintf(pHlp, " GCPhysVmxon = %#RGp\n", pCtx->hwvirt.vmx.GCPhysVmxon); 4124 4102 pHlp->pfnPrintf(pHlp, " GCPhysVmcs = %#RGp\n", pCtx->hwvirt.vmx.GCPhysVmcs); … … 4140 4118 cpumR3InfoVmxVmcs(pVCpu, pHlp, pCtx->hwvirt.vmx.pVmcsR3, " " /* pszPrefix */); 4141 4119 } 4120 else 4121 pHlp->pfnPrintf(pHlp, "Hwvirt state disabled.\n"); 4142 4122 4143 4123 #undef CPUMHWVIRTDUMP_NONE
Note:
See TracChangeset
for help on using the changeset viewer.