Changeset 56558 in vbox
- Timestamp:
- Jun 19, 2015 12:05:26 PM (9 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 3 edited
-
SUPDrv.cpp (modified) (3 diffs)
-
SUPDrvInternal.h (modified) (1 diff)
-
darwin/SUPDrv-darwin.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r56493 r56558 3928 3928 * (centaur) CPU. 3929 3929 * 3930 * @param pSession The session handle.3931 3930 * @param pfCaps Where to store the capabilities. 3932 3931 */ 3933 SUPR0DECL(int) SUPR0QueryVTCaps(PSUPDRVSESSION pSession,uint32_t *pfCaps)3932 int VBOXCALL supdrvQueryVTCapsInternal(uint32_t *pfCaps) 3934 3933 { 3935 3934 int rc = VERR_UNSUPPORTED_CPU; … … 3940 3939 * Input validation. 3941 3940 */ 3942 AssertReturn(SUP_IS_SESSION_VALID(pSession), VERR_INVALID_PARAMETER);3943 3941 AssertPtrReturn(pfCaps, VERR_INVALID_POINTER); 3944 3942 … … 4021 4019 SUPR0Printf(("WARNING! CR4 hints SMX mode but your CPU is too secretive. Proceeding anyway... We wish you good luck!\n")); 4022 4020 return rc; 4021 } 4022 4023 /** 4024 * Queries the AMD-V and VT-x capabilities of the calling CPU. 4025 * 4026 * @returns VBox status code. 4027 * @retval VERR_VMX_NO_VMX 4028 * @retval VERR_VMX_MSR_ALL_VMXON_DISABLED 4029 * @retval VERR_VMX_MSR_VMXON_DISABLED 4030 * @retval VERR_VMX_MSR_LOCKING_FAILED 4031 * @retval VERR_SVM_NO_SVM 4032 * @retval VERR_SVM_DISABLED 4033 * @retval VERR_UNSUPPORTED_CPU if not identifiable as an AMD, Intel or VIA 4034 * (centaur) CPU. 4035 * 4036 * @param pSession The session handle. 4037 * @param pfCaps Where to store the capabilities. 4038 */ 4039 SUPR0DECL(int) SUPR0QueryVTCaps(PSUPDRVSESSION pSession, uint32_t *pfCaps) 4040 { 4041 /* 4042 * Input validation. 4043 */ 4044 AssertReturn(SUP_IS_SESSION_VALID(pSession), VERR_INVALID_PARAMETER); 4045 AssertPtrReturn(pfCaps, VERR_INVALID_POINTER); 4046 4047 /* 4048 * Call common worker. 4049 */ 4050 return supdrvQueryVTCapsInternal(pfCaps); 4023 4051 } 4024 4052 -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r56293 r56558 942 942 uint32_t VBOXCALL supdrvSessionRetain(PSUPDRVSESSION pSession); 943 943 uint32_t VBOXCALL supdrvSessionRelease(PSUPDRVSESSION pSession); 944 int VBOXCALL supdrvQueryVTCapsInternal(uint32_t *pfCaps); 944 945 945 946 /* SUPDrvGip.cpp */ -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r56375 r56558 902 902 903 903 904 #ifdef VBOX_WITH_HOST_VMX 905 /** 906 * For cleaning up the mess we left behind on Yosemite with 4.3.28 and earlier. 907 * 908 * We ASSUME VT-x is supported by the CPU. 909 * 910 * @param idCpu Unused. 911 * @param pvUser1 Unused. 912 * @param pvUser2 Unused. 913 */ 914 static DECLCALLBACK(void) vboxdrvDarwinVmxEnableFix(RTCPUID idCpu, void *pvUser1, void *pvUser2) 915 { 916 RTCCUINTREG uCr4 = ASMGetCR4(); 917 if (!(uCr4 & X86_CR4_VMXE)) 918 { 919 uCr4 |= X86_CR4_VMXE; 920 ASMSetCR4(uCr4); 921 } 922 } 923 #endif 924 925 904 926 /** 905 927 * @copydoc SUPR0EnableVTx … … 919 941 if (fEnable) 920 942 { 943 /* 944 * We screwed up on Yosemite and didn't notice that we weren't 945 * calling host_vmxon. CR4.VMXE may therefor have been disabled 946 * by us. So, first time around we make sure it's set so we won't 947 * crash in the pre-4.3.28/5.0RC1 upgrade scenario. 948 */ 949 static bool volatile g_fDoneCleanup = false; 950 if (!g_fDoneCleanup) 951 { 952 if (version_major == 14 /* 14 = 10.10 = yosemite */) 953 { 954 uint32_t fCaps; 955 int rc = supdrvQueryVTCapsInternal(&fCaps); 956 if (RT_SUCCESS(rc)) 957 { 958 if (fCaps & SUPVTCAPS_VT_X) 959 rc = RTMpOnAll(vboxdrvDarwinVmxEnableFix, NULL, NULL); 960 else 961 rc = VERR_VMX_NO_VMX; 962 } 963 if (RT_FAILURE(rc)) 964 return rc; 965 } 966 g_fDoneCleanup = true; 967 } 968 969 /* 970 * Call the kernel. 971 */ 921 972 rc = host_vmxon(false /* exclusive */); 922 973 if (rc == VMX_OK)
Note:
See TracChangeset
for help on using the changeset viewer.

