- Timestamp:
- Nov 9, 2023 11:27:42 AM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 160120
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/hm_vmx.h
r101449 r102020 3816 3816 /** @name VMX_V_VMCS_STATE_XXX - Virtual VMCS launch state. 3817 3817 * @{ */ 3818 /** VMCS launch state clear legacy value -- deprecated!!!. */ 3819 #define VMX_V_VMCS_LAUNCH_STATE_CLEAR_LEGACY RT_BIT(0) 3818 3820 /** VMCS launch state clear. */ 3819 #define VMX_V_VMCS_LAUNCH_STATE_CLEAR RT_BIT(0) 3820 /** VMCS launch state active. */ 3821 #define VMX_V_VMCS_LAUNCH_STATE_ACTIVE RT_BIT(1) 3822 /** VMCS launch state current. */ 3823 #define VMX_V_VMCS_LAUNCH_STATE_CURRENT RT_BIT(2) 3821 #define VMX_V_VMCS_LAUNCH_STATE_CLEAR (0) 3822 /* Bit 1 used to be "active", no longer used. */ 3823 /* Bit 2 used to be "current", no longer used. */ 3824 3824 /** VMCS launch state launched. */ 3825 3825 #define VMX_V_VMCS_LAUNCH_STATE_LAUNCHED RT_BIT(3) 3826 /** The mask of valid VMCS launch states. */3827 #define VMX_V_VMCS_LAUNCH_STATE_MASK ( VMX_V_VMCS_LAUNCH_STATE_CLEAR \3828 | VMX_V_VMCS_LAUNCH_STATE_ACTIVE \3829 | VMX_V_VMCS_LAUNCH_STATE_CURRENT \3830 | VMX_V_VMCS_LAUNCH_STATE_LAUNCHED)3831 3826 /** @} */ 3832 3827 -
trunk/include/VBox/vmm/hmvmxinline.h
r98103 r102020 289 289 switch (fVmcsState) 290 290 { 291 case VMX_V_VMCS_LAUNCH_STATE_CLEAR: return "Clear"; 292 case VMX_V_VMCS_LAUNCH_STATE_LAUNCHED: return "Launched"; 293 default: return "Unknown"; 291 case VMX_V_VMCS_LAUNCH_STATE_CLEAR: return "Clear"; 292 case VMX_V_VMCS_LAUNCH_STATE_CLEAR_LEGACY: return "Clear (Legacy("; 293 case VMX_V_VMCS_LAUNCH_STATE_LAUNCHED: return "Launched"; 294 default: return "Unknown"; 294 295 } 295 296 } -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp
r101487 r102020 2449 2449 Assert(VMXINSTRID_IS_VALID(uInstrId)); 2450 2450 Assert(VMXINSTRID_GET_ID(uInstrId) == (uInstrId & 0x3)); 2451 Assert(GCPtrDisp == 0); 2451 2452 Assert(ExitInstrInfo.RdrandRdseed.u2OperandSize != 3); 2452 2453 ExitInstrInfo.RdrandRdseed.u3Undef0 = 0; … … 7822 7823 7823 7824 /* Current VMCS is not a shadow VMCS. */ 7824 if (!pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs.u32VmcsRevId.n.fIsShadowVmcs) 7825 PVMXVVMCS pVmcs = &pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs; 7826 if (!pVmcs->u32VmcsRevId.n.fIsShadowVmcs) 7825 7827 { /* likely */ } 7826 7828 else … … 7847 7849 { 7848 7850 /* VMLAUNCH with non-clear VMCS. */ 7849 if (pV Cpu->cpum.GstCtx.hwvirt.vmx.Vmcs.fVmcsState == VMX_V_VMCS_LAUNCH_STATE_CLEAR)7851 if (pVmcs->fVmcsState == VMX_V_VMCS_LAUNCH_STATE_CLEAR) 7850 7852 { /* likely */ } 7853 else if (pVmcs->fVmcsState == VMX_V_VMCS_LAUNCH_STATE_CLEAR_LEGACY) 7854 { 7855 /* Convert legacy launch-state value to current value, see @bugref{10318#c114} for reasons.*/ 7856 pVmcs->fVmcsState = VMX_V_VMCS_LAUNCH_STATE_CLEAR; 7857 Log(("vmlaunch: Updated legacy 'VMCLEAR' VMCS launch-state bit to current\n")); 7858 } 7851 7859 else 7852 7860 { 7853 Log(("vmlaunch: VMLAUNCH with non-clear VMCS -> VMFail\n"));7861 Log(("vmlaunch: VMLAUNCH with non-clear VMCS %RGp -> VMFail\n", pVCpu->cpum.GstCtx.hwvirt.vmx.GCPhysVmcs)); 7854 7862 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Vmentry_VmcsClear; 7855 7863 iemVmxVmFail(pVCpu, VMXINSTRERR_VMLAUNCH_NON_CLEAR_VMCS); … … 7860 7868 { 7861 7869 /* VMRESUME with non-launched VMCS. */ 7862 if (pV Cpu->cpum.GstCtx.hwvirt.vmx.Vmcs.fVmcsState == VMX_V_VMCS_LAUNCH_STATE_LAUNCHED)7870 if (pVmcs->fVmcsState == VMX_V_VMCS_LAUNCH_STATE_LAUNCHED) 7863 7871 { /* likely */ } 7864 7872 else … … 7903 7911 */ 7904 7912 iemVmxVmentrySaveNmiBlockingFF(pVCpu); 7905 7906 PVMXVVMCS pVmcs = &pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs;7907 Assert(pVmcs);7908 7913 7909 7914 rc = iemVmxVmentryCheckGuestState(pVCpu, pszInstr); … … 8997 9002 if (VM_IS_HM_ENABLED(pVCpu->CTX_SUFF(pVM))) 8998 9003 HMNotifyVmxNstGstCurrentVmcsChanged(pVCpu); 9004 9005 /* Convert legacy launch-state value to current value, see @bugref{10318#c114} for reasons.*/ 9006 if (pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs.fVmcsState == VMX_V_VMCS_LAUNCH_STATE_CLEAR_LEGACY) 9007 { 9008 pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs.fVmcsState = VMX_V_VMCS_LAUNCH_STATE_CLEAR; 9009 Log(("vmptrld: Updated legacy 'VMCLEAR' VMCS launch-state bit to current\n")); 9010 } 8999 9011 } 9000 9012 else … … 9005 9017 return rc; 9006 9018 } 9019 } 9020 else if ( IEM_VMX_HAS_CURRENT_VMCS(pVCpu) 9021 && pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs.fVmcsState == VMX_V_VMCS_LAUNCH_STATE_CLEAR_LEGACY) 9022 { 9023 /* Convert legacy launch-state value to current value, see @bugref{10318#c114} for reasons.*/ 9024 pVCpu->cpum.GstCtx.hwvirt.vmx.Vmcs.fVmcsState = VMX_V_VMCS_LAUNCH_STATE_CLEAR; 9025 Log(("vmptrld: Updated legacy VMCLEAR launch-state bit to current\n")); 9007 9026 } 9008 9027 -
trunk/src/VBox/VMM/VMMAll/VMXAllTemplate.cpp.h
r101060 r102020 934 934 Assert(pVmcsInfo->HCPhysShadowVmcs != 0 && pVmcsInfo->HCPhysShadowVmcs != NIL_RTHCPHYS); 935 935 936 int rc = VMXLoadVmcs(pVmcsInfo->HCPhysShadowVmcs); 937 if (RT_SUCCESS(rc)) 938 pVmcsInfo->fShadowVmcsState |= VMX_V_VMCS_LAUNCH_STATE_CURRENT; 939 return rc; 936 return VMXLoadVmcs(pVmcsInfo->HCPhysShadowVmcs); 940 937 } 941 938 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r100993 r102020 285 285 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 286 286 287 int rc = VMXLoadVmcs(pVmcsInfo->HCPhysVmcs); 288 if (RT_SUCCESS(rc)) 289 pVmcsInfo->fVmcsState |= VMX_V_VMCS_LAUNCH_STATE_CURRENT; 290 return rc; 287 return VMXLoadVmcs(pVmcsInfo->HCPhysVmcs); 291 288 } 292 289 … … 3013 3010 } 3014 3011 else 3015 LogRelFunc(("Failed to load the %s. rc=%Rrc\n", rc, pszVmcs));3012 LogRelFunc(("Failed to load the %s. rc=%Rrc\n", pszVmcs, rc)); 3016 3013 } 3017 3014 else
Note:
See TracChangeset
for help on using the changeset viewer.