Changeset 57051 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Jul 22, 2015 9:44:48 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r57041 r57051 3794 3794 fMaybeSmxMode = RT_BOOL(ASMGetCR4() & X86_CR4_SMXE); 3795 3795 fMsrLocked = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_LOCK); 3796 fSmxVmxAllowed = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_SMX_VMX ON);3797 fVmxAllowed = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_VMX ON);3796 fSmxVmxAllowed = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_SMX_VMX); 3797 fVmxAllowed = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_VMX); 3798 3798 fIsSmxModeAmbiguous = false; 3799 3799 rc = VERR_INTERNAL_ERROR_5; … … 3805 3805 rc = VINF_SUCCESS; 3806 3806 else if (!fVmxAllowed && !fSmxVmxAllowed) 3807 rc = VERR_VMX_MSR_ALL_VMX ON_DISABLED;3807 rc = VERR_VMX_MSR_ALL_VMX_DISABLED; 3808 3808 else if (!fMaybeSmxMode) 3809 3809 { … … 3811 3811 rc = VINF_SUCCESS; 3812 3812 else 3813 rc = VERR_VMX_MSR_VMX ON_DISABLED;3813 rc = VERR_VMX_MSR_VMX_DISABLED; 3814 3814 } 3815 3815 else … … 3831 3831 * this MSR can no longer be modified. 3832 3832 * 3833 * Set both the VMX ON and SMX_VMXONbits (if supported) as we can't determine SMX mode3833 * Set both the VMX and SMX_VMX bits (if supported) as we can't determine SMX mode 3834 3834 * accurately. See @bugref{6873}. 3835 3835 * 3836 * We need to check for VMX-in-SMX hardware support here, before writing the MSR as3836 * We need to check for SMX hardware support here, before writing the MSR as 3837 3837 * otherwise we will #GP fault on CPUs that do not support it. Callers do not check 3838 3838 * for it. … … 3855 3855 3856 3856 u64FeatMsr |= MSR_IA32_FEATURE_CONTROL_LOCK 3857 | MSR_IA32_FEATURE_CONTROL_VMX ON;3857 | MSR_IA32_FEATURE_CONTROL_VMX; 3858 3858 if (fSmxVmxHwSupport) 3859 u64FeatMsr |= MSR_IA32_FEATURE_CONTROL_SMX_VMX ON;3859 u64FeatMsr |= MSR_IA32_FEATURE_CONTROL_SMX_VMX; 3860 3860 3861 3861 /* … … 3880 3880 else 3881 3881 fMsrLocked = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_LOCK); 3882 fSmxVmxAllowed = fMsrLocked && RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_SMX_VMXON); 3883 fVmxAllowed = fMsrLocked && RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_VMXON); 3884 if ( fVmxAllowed 3885 && ( !fSmxVmxHwSupport 3886 || fSmxVmxAllowed)) 3887 rc = VINF_SUCCESS; 3882 3883 if (fMsrLocked) 3884 { 3885 fSmxVmxAllowed = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_SMX_VMX); 3886 fVmxAllowed = RT_BOOL(u64FeatMsr & MSR_IA32_FEATURE_CONTROL_VMX); 3887 if ( fVmxAllowed 3888 && ( !fSmxVmxHwSupport 3889 || fSmxVmxAllowed)) 3890 { 3891 rc = VINF_SUCCESS; 3892 } 3893 else 3894 rc = !fSmxVmxHwSupport ? VERR_VMX_MSR_VMX_ENABLE_FAILED : VERR_VMX_MSR_SMX_VMX_ENABLE_FAILED; 3895 } 3888 3896 else 3889 3897 rc = VERR_VMX_MSR_LOCKING_FAILED; … … 3949 3957 * @returns VBox status code. 3950 3958 * @retval VERR_VMX_NO_VMX 3951 * @retval VERR_VMX_MSR_ALL_VMX ON_DISABLED3952 * @retval VERR_VMX_MSR_VMX ON_DISABLED3959 * @retval VERR_VMX_MSR_ALL_VMX_DISABLED 3960 * @retval VERR_VMX_MSR_VMX_DISABLED 3953 3961 * @retval VERR_VMX_MSR_LOCKING_FAILED 3962 * @retval VERR_VMX_MSR_VMX_ENABLE_FAILED 3963 * @retval VERR_VMX_MSR_SMX_VMX_ENABLE_FAILED 3954 3964 * @retval VERR_SVM_NO_SVM 3955 3965 * @retval VERR_SVM_DISABLED … … 4055 4065 * @returns VBox status code. 4056 4066 * @retval VERR_VMX_NO_VMX 4057 * @retval VERR_VMX_MSR_ALL_VMX ON_DISABLED4058 * @retval VERR_VMX_MSR_VMX ON_DISABLED4067 * @retval VERR_VMX_MSR_ALL_VMX_DISABLED 4068 * @retval VERR_VMX_MSR_VMX_DISABLED 4059 4069 * @retval VERR_VMX_MSR_LOCKING_FAILED 4070 * @retval VERR_VMX_MSR_VMX_ENABLE_FAILED 4071 * @retval VERR_VMX_MSR_SMX_VMX_ENABLE_FAILED 4060 4072 * @retval VERR_SVM_NO_SVM 4061 4073 * @retval VERR_SVM_DISABLED
Note:
See TracChangeset
for help on using the changeset viewer.