Changeset 91323 in vbox
- Timestamp:
- Sep 22, 2021 10:04:56 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146984
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.h
r91306 r91323 1481 1481 uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx); 1482 1482 VMMDECL(uint64_t) CPUMGetGuestEFER(PCVMCPU pVCpu); 1483 VMM_INT_DECL(uint64_t) CPUMGetGuestIa32FeatCtrl(PCVMCPUCC pVCpu); 1483 1484 VMM_INT_DECL(uint64_t) CPUMGetGuestIa32MtrrCap(PCVMCPU pVCpu); 1484 1485 VMM_INT_DECL(uint64_t) CPUMGetGuestIa32SmmMonitorCtl(PCVMCPU pVCpu); -
trunk/include/VBox/vmm/hm_vmx.h
r91120 r91323 1197 1197 typedef struct VMXMSRS 1198 1198 { 1199 /** VMX/SMX Feature control. */1200 uint64_t u64FeatCtrl;1201 1199 /** Basic information. */ 1202 1200 uint64_t u64Basic; … … 1238 1236 uint64_t u64ProcCtls3; 1239 1237 /** Reserved for future. */ 1240 uint64_t a_u64Reserved[ 8];1238 uint64_t a_u64Reserved[9]; 1241 1239 } VMXMSRS; 1242 1240 AssertCompileSizeAlignment(VMXMSRS, 8); -
trunk/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
r91266 r91323 236 236 } 237 237 238 /** 239 * Get IA32_FEATURE_CONTROL value for IEM, NEM and cpumMsrRd_Ia32FeatureControl. 240 * 241 * @returns IA32_FEATURE_CONTROL value. 242 * @param pVCpu The cross context per CPU structure. 243 */ 244 VMM_INT_DECL(uint64_t) CPUMGetGuestIa32FeatCtrl(PCVMCPUCC pVCpu) 245 { 246 uint64_t uFeatCtrlMsr = MSR_IA32_FEATURE_CONTROL_LOCK; 247 if (pVCpu->CTX_SUFF(pVM)->cpum.s.GuestFeatures.fVmx) 248 uFeatCtrlMsr |= MSR_IA32_FEATURE_CONTROL_VMXON; 249 return uFeatCtrlMsr; 250 } 251 238 252 239 253 /** @callback_method_impl{FNCPUMRDMSR} */ … … 241 255 { 242 256 RT_NOREF_PV(idMsr); RT_NOREF_PV(pRange); 243 *puValue = pVCpu->cpum.s.Guest.hwvirt.vmx.Msrs.u64FeatCtrl;257 *puValue = CPUMGetGuestIa32FeatCtrl(pVCpu); 244 258 return VINF_SUCCESS; 245 259 } -
trunk/src/VBox/VMM/VMMAll/HMAll.cpp
r91271 r91323 821 821 AssertReturnVoid(pHwvirtMsrs); 822 822 AssertReturnVoid(pVmxMsrs); 823 pVmxMsrs->u64FeatCtrl = pHwvirtMsrs->u.vmx.u64FeatCtrl;824 823 pVmxMsrs->u64Basic = pHwvirtMsrs->u.vmx.u64Basic; 825 824 pVmxMsrs->PinCtls.u = pHwvirtMsrs->u.vmx.PinCtls.u; -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r91305 r91323 8495 8495 8496 8496 /* Feature control MSR's LOCK and VMXON bits. */ 8497 uint64_t const uMsrFeatCtl = pVCpu->cpum.GstCtx.hwvirt.vmx.Msrs.u64FeatCtrl;8497 uint64_t const uMsrFeatCtl = CPUMGetGuestIa32FeatCtrl(pVCpu); 8498 8498 if ((uMsrFeatCtl & (MSR_IA32_FEATURE_CONTROL_LOCK | MSR_IA32_FEATURE_CONTROL_VMXON)) 8499 8499 == (MSR_IA32_FEATURE_CONTROL_LOCK | MSR_IA32_FEATURE_CONTROL_VMXON)) -
trunk/src/VBox/VMM/VMMR0/HMR0.cpp
r91281 r91323 388 388 g_uHmVmxHostMsrEfer = ASMRdMsr(MSR_K6_EFER); 389 389 390 /* Get VMX MSRs for determining VMX features we can ultimately use. */390 /* Get VMX MSRs (and feature control MSR) for determining VMX features we can ultimately use. */ 391 391 SUPR0GetHwvirtMsrs(&g_HmMsrs, SUPVTCAPS_VT_X, false /* fForce */); 392 392 … … 1178 1178 pVM->hm.s.ForR3.vmx.u64HostMsrEfer = g_uHmVmxHostMsrEfer; 1179 1179 pVM->hm.s.ForR3.vmx.u64HostSmmMonitorCtl = g_uHmVmxHostSmmMonitorCtl; 1180 pVM->hm.s.ForR3.vmx.u64HostFeatCtrl = g_HmMsrs.u.vmx.u64FeatCtrl; 1180 1181 HMGetVmxMsrsFromHwvirtMsrs(&g_HmMsrs, &pVM->hm.s.ForR3.vmx.Msrs); 1181 1182 /* If you need to tweak host MSRs for testing VMX R0 code, do it here. */ -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r91281 r91323 2115 2115 { 2116 2116 Assert(pInput->Names[iReg] == HvX64RegisterIa32FeatureControl); 2117 if (paValues[iReg].Reg64 != pCtx->hwvirt.vmx.Msrs.u64FeatCtrl) 2118 Log7(("NEM/%u: MSR FEATURE_CONTROL changed %RX64 -> %RX64 (!!)\n", pGVCpu->idCpu, pCtx->hwvirt.vmx.Msrs.u64FeatCtrl, paValues[iReg].Reg64)); 2117 uint64_t const uFeatCtrl = CPUMGetGuestIa32FeatCtrl(pVCpu); 2118 if (paValues[iReg].Reg64 != uFeatCtrl) 2119 Log7(("NEM/%u: MSR FEATURE_CONTROL changed %RX64 -> %RX64 (!!)\n", pGVCpu->idCpu, uFeatCtrl, paValues[iReg].Reg64)); 2119 2120 iReg++; 2120 2121 } -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r91306 r91323 1277 1277 */ 1278 1278 1279 /* Feature control. */1280 pGuestVmxMsrs->u64FeatCtrl = MSR_IA32_FEATURE_CONTROL_LOCK | MSR_IA32_FEATURE_CONTROL_VMXON;1281 1282 1279 /* Basic information. */ 1283 1280 { … … 2407 2404 SSMR3PutU16(pSSM, pGstCtx->hwvirt.vmx.offVirtApicWrite); 2408 2405 SSMR3PutBool(pSSM, pGstCtx->hwvirt.vmx.fVirtNmiBlocking); 2409 SSMR3PutU64(pSSM, pGstCtx->hwvirt.vmx.Msrs.u64FeatCtrl);2406 SSMR3PutU64(pSSM, MSR_IA32_FEATURE_CONTROL_LOCK | MSR_IA32_FEATURE_CONTROL_VMXON); /* Deprecated since 2021/09/22. Value kept backwards compatibile with 6.1.26. */ 2410 2407 SSMR3PutU64(pSSM, pGstCtx->hwvirt.vmx.Msrs.u64Basic); 2411 2408 SSMR3PutU64(pSSM, pGstCtx->hwvirt.vmx.Msrs.PinCtls.u); … … 2697 2694 SSMR3GetU16(pSSM, &pGstCtx->hwvirt.vmx.offVirtApicWrite); 2698 2695 SSMR3GetBool(pSSM, &pGstCtx->hwvirt.vmx.fVirtNmiBlocking); 2699 SSMR3 GetU64(pSSM, &pGstCtx->hwvirt.vmx.Msrs.u64FeatCtrl);2696 SSMR3Skip(pSSM, sizeof(uint64_t)); /* Unused - used to be IA32_FEATURE_CONTROL, see @bugref{10106}. */ 2700 2697 SSMR3GetU64(pSSM, &pGstCtx->hwvirt.vmx.Msrs.u64Basic); 2701 2698 SSMR3GetU64(pSSM, &pGstCtx->hwvirt.vmx.Msrs.PinCtls.u); -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r91270 r91323 1052 1052 { 1053 1053 LogRel(("HM: Failed to initialize VT-x / AMD-V: %Rrc\n", pVM->hm.s.ForR3.rcInit)); 1054 LogRel(("HM: VMX MSR_IA32_FEATURE_CONTROL=%RX64\n", pVM->hm.s.ForR3.vmx. Msrs.u64FeatCtrl));1054 LogRel(("HM: VMX MSR_IA32_FEATURE_CONTROL=%RX64\n", pVM->hm.s.ForR3.vmx.u64HostFeatCtrl)); 1055 1055 switch (pVM->hm.s.ForR3.rcInit) 1056 1056 { … … 1493 1493 1494 1494 LogFunc(("pVM->hm.s.vmx.fSupported = %d\n", pVM->hm.s.vmx.fSupported)); 1495 AssertLogRelReturn(pVM->hm.s.ForR3.vmx. Msrs.u64FeatCtrl != 0, VERR_HM_IPE_4);1495 AssertLogRelReturn(pVM->hm.s.ForR3.vmx.u64HostFeatCtrl != 0, VERR_HM_IPE_4); 1496 1496 1497 1497 LogRel(("HM: Using VT-x implementation 3.0\n")); 1498 1498 LogRel(("HM: Max resume loops = %u\n", pVM->hm.s.cMaxResumeLoopsCfg)); 1499 1499 LogRel(("HM: Host CR4 = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostCr4)); 1500 LogRel(("HM: Host EFER= %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostMsrEfer));1500 LogRel(("HM: MSR_IA32_EFER = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostMsrEfer)); 1501 1501 LogRel(("HM: MSR_IA32_SMM_MONITOR_CTL = %#RX64\n", pVM->hm.s.ForR3.vmx.u64HostSmmMonitorCtl)); 1502 1502 1503 hmR3VmxReportFeatCtlMsr(pVM->hm.s.ForR3.vmx. Msrs.u64FeatCtrl);1503 hmR3VmxReportFeatCtlMsr(pVM->hm.s.ForR3.vmx.u64HostFeatCtrl); 1504 1504 hmR3VmxReportBasicMsr(pVM->hm.s.ForR3.vmx.Msrs.u64Basic); 1505 1505 -
trunk/src/VBox/VMM/include/HMInternal.h
r91265 r91323 545 545 /** Host EFER value (set by ring-0 VMX init, for logging and guest NX). */ 546 546 uint64_t u64HostMsrEfer; 547 /** Host IA32_FEATURE_CONTROL MSR (set by ring-0 VMX init, for logging). */ 548 uint64_t u64HostFeatCtrl; 547 549 548 550 /** The first valid host LBR branch-from-IP stack range. */
Note:
See TracChangeset
for help on using the changeset viewer.