Changeset 107703 in vbox for trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin.cpp
- Timestamp:
- Jan 11, 2025 10:55:53 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3Native-darwin.cpp
r107115 r107703 2203 2203 /* 2204 2204 * Get MSR_IA32_ARCH_CAPABILITIES and expand it into the host feature structure. 2205 * 2205 2206 * This is only available with 11.0+ (BigSur) as the required API is only available there, 2206 2207 * we could in theory initialize this when creating the EMTs using hv_vcpu_read_msr() but 2207 2208 * the required vCPU handle is created after CPUM was initialized which is too late. 2208 2209 * Given that the majority of users is on 11.0 and later we don't care for now. 2210 * 2211 * (Yes, this is done after CPUM init.) 2209 2212 */ 2213 uint64_t fHostArchVal = 0; 2214 bool fHasArchCap = false; 2210 2215 if ( hrc == HV_SUCCESS 2211 2216 && hv_vmx_get_msr_info) 2212 2217 { 2213 g_CpumHostFeatures.s.fArchRdclNo = 0;2214 g_CpumHostFeatures.s.fArchIbrsAll = 0;2215 g_CpumHostFeatures.s.fArchRsbOverride = 0;2216 g_CpumHostFeatures.s.fArchVmmNeedNotFlushL1d = 0;2217 g_CpumHostFeatures.s.fArchMdsNo = 0;2218 2218 uint32_t const cStdRange = ASMCpuId_EAX(0); 2219 2219 if ( RTX86IsValidStdRange(cStdRange) … … 2226 2226 && (fStdFeaturesEdx & X86_CPUID_FEATURE_EDX_MSR)) 2227 2227 { 2228 uint64_t fArchVal; 2229 hrc = hv_vmx_get_msr_info(HV_VMX_INFO_MSR_IA32_ARCH_CAPABILITIES, &fArchVal); 2230 if (hrc == HV_SUCCESS) 2231 { 2232 g_CpumHostFeatures.s.fArchRdclNo = RT_BOOL(fArchVal & MSR_IA32_ARCH_CAP_F_RDCL_NO); 2233 g_CpumHostFeatures.s.fArchIbrsAll = RT_BOOL(fArchVal & MSR_IA32_ARCH_CAP_F_IBRS_ALL); 2234 g_CpumHostFeatures.s.fArchRsbOverride = RT_BOOL(fArchVal & MSR_IA32_ARCH_CAP_F_RSBO); 2235 g_CpumHostFeatures.s.fArchVmmNeedNotFlushL1d = RT_BOOL(fArchVal & MSR_IA32_ARCH_CAP_F_VMM_NEED_NOT_FLUSH_L1D); 2236 g_CpumHostFeatures.s.fArchMdsNo = RT_BOOL(fArchVal & MSR_IA32_ARCH_CAP_F_MDS_NO); 2237 } 2228 fHasArchCap = true; 2229 hrc = hv_vmx_get_msr_info(HV_VMX_INFO_MSR_IA32_ARCH_CAPABILITIES, &fHostArchVal); 2230 if (hrc != HV_SUCCESS) 2231 fHostArchVal = 0; 2238 2232 } 2239 else 2240 g_CpumHostFeatures.s.fArchCap = 0; 2241 } 2242 } 2233 } 2234 } 2235 CPUMCpuIdApplyX86HostArchCapabilities(pVM, fHasArchCap, fHostArchVal); 2243 2236 2244 2237 return nemR3DarwinHvSts2Rc(hrc);
Note:
See TracChangeset
for help on using the changeset viewer.