Changeset 93515 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jan 31, 2022 10:17:19 PM (3 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r93387 r93515 4301 4301 uint32_t uMaxLeaf, uVendorEbx, uVendorEcx, uVendorEdx; 4302 4302 ASMCpuId(0, &uMaxLeaf, &uVendorEbx, &uVendorEcx, &uVendorEdx); 4303 if ( ASMIsValidStdRange(uMaxLeaf))4303 if (RTX86IsValidStdRange(uMaxLeaf)) 4304 4304 { 4305 4305 /* Query the standard CPUID leaf. */ … … 4308 4308 4309 4309 /* Check if the vendor is Intel (or compatible). */ 4310 if ( ASMIsIntelCpuEx(uVendorEbx, uVendorEcx, uVendorEdx)4311 || ASMIsViaCentaurCpuEx(uVendorEbx, uVendorEcx, uVendorEdx)4312 || ASMIsShanghaiCpuEx(uVendorEbx, uVendorEcx, uVendorEdx))4310 if ( RTX86IsIntelCpu(uVendorEbx, uVendorEcx, uVendorEdx) 4311 || RTX86IsViaCentaurCpu(uVendorEbx, uVendorEcx, uVendorEdx) 4312 || RTX86IsShanghaiCpu(uVendorEbx, uVendorEcx, uVendorEdx)) 4313 4313 { 4314 4314 /* Check VT-x support. In addition, VirtualBox requires MSR and FXSAVE/FXRSTOR to function. */ … … 4324 4324 4325 4325 /* Check if the vendor is AMD (or compatible). */ 4326 if ( ASMIsAmdCpuEx(uVendorEbx, uVendorEcx, uVendorEdx)4327 || ASMIsHygonCpuEx(uVendorEbx, uVendorEcx, uVendorEdx))4326 if ( RTX86IsAmdCpu(uVendorEbx, uVendorEcx, uVendorEdx) 4327 || RTX86IsHygonCpu(uVendorEbx, uVendorEcx, uVendorEdx)) 4328 4328 { 4329 4329 uint32_t fExtFeatEcx, uExtMaxId; … … 4332 4332 4333 4333 /* Check AMD-V support. In addition, VirtualBox requires MSR and FXSAVE/FXRSTOR to function. */ 4334 if ( ASMIsValidExtRange(uExtMaxId)4334 if ( RTX86IsValidExtRange(uExtMaxId) 4335 4335 && uExtMaxId >= 0x8000000a 4336 4336 && (fExtFeatEcx & X86_CPUID_AMD_FEATURE_ECX_SVM) … … 4428 4428 uint32_t uMaxId, uVendorEBX, uVendorECX, uVendorEDX; 4429 4429 ASMCpuId(0, &uMaxId, &uVendorEBX, &uVendorECX, &uVendorEDX); 4430 Assert( ASMIsValidStdRange(uMaxId));4431 Assert( ASMIsIntelCpuEx( uVendorEBX, uVendorECX, uVendorEDX)4432 || ASMIsViaCentaurCpuEx(uVendorEBX, uVendorECX, uVendorEDX)4433 || ASMIsShanghaiCpuEx( uVendorEBX, uVendorECX, uVendorEDX));4430 Assert(RTX86IsValidStdRange(uMaxId)); 4431 Assert( RTX86IsIntelCpu( uVendorEBX, uVendorECX, uVendorEDX) 4432 || RTX86IsViaCentaurCpu(uVendorEBX, uVendorECX, uVendorEDX) 4433 || RTX86IsShanghaiCpu( uVendorEBX, uVendorECX, uVendorEDX)); 4434 4434 #endif 4435 4435 ASMCpuId(1, &uDummy, &uDummy, &fFeaturesECX, &uDummy); … … 4679 4679 ASMCpuId(1, &uTFMSEAX, &uDummy, &uDummy, &uDummy); 4680 4680 4681 if ( ASMIsValidStdRange(uMaxId))4681 if (RTX86IsValidStdRange(uMaxId)) 4682 4682 { 4683 4683 uint64_t uRevMsr; 4684 if ( ASMIsIntelCpuEx(uVendorEBX, uVendorECX, uVendorEDX))4684 if (RTX86IsIntelCpu(uVendorEBX, uVendorECX, uVendorEDX)) 4685 4685 { 4686 4686 /* Architectural MSR available on Pentium Pro and later. */ 4687 if ( ASMGetCpuFamily(uTFMSEAX) >= 6)4687 if (RTX86GetCpuFamily(uTFMSEAX) >= 6) 4688 4688 { 4689 4689 /* Revision is in the high dword. */ … … 4693 4693 } 4694 4694 } 4695 else if ( ASMIsAmdCpuEx(uVendorEBX, uVendorECX, uVendorEDX)4696 || ASMIsHygonCpuEx(uVendorEBX, uVendorECX, uVendorEDX))4695 else if ( RTX86IsAmdCpu(uVendorEBX, uVendorECX, uVendorEDX) 4696 || RTX86IsHygonCpu(uVendorEBX, uVendorECX, uVendorEDX)) 4697 4697 { 4698 4698 /* Not well documented, but at least all AMD64 CPUs support this. */ 4699 if ( ASMGetCpuFamily(uTFMSEAX) >= 15)4699 if (RTX86GetCpuFamily(uTFMSEAX) >= 15) 4700 4700 { 4701 4701 /* Revision is in the low dword. */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
r93115 r93515 199 199 /* The Intel CPU topology leaf: */ 200 200 uint32_t uOther = ASMCpuId_EAX(0); 201 if (uOther >= UINT32_C(0xb) && ASMIsValidStdRange(uOther))201 if (uOther >= UINT32_C(0xb) && RTX86IsValidStdRange(uOther)) 202 202 { 203 203 uint32_t uEax = 0; … … 220 220 /* The AMD leaf: */ 221 221 uOther = ASMCpuId_EAX(UINT32_C(0x80000000)); 222 if (uOther >= UINT32_C(0x8000001e) && ASMIsValidExtRange(uOther))222 if (uOther >= UINT32_C(0x8000001e) && RTX86IsValidExtRange(uOther)) 223 223 { 224 224 uOther = ASMGetApicIdExt8000001E(); … … 371 371 if (ASMHasCpuId()) 372 372 { 373 if ( ASMIsValidExtRange(ASMCpuId_EAX(UINT32_C(0x80000000)))373 if ( RTX86IsValidExtRange(ASMCpuId_EAX(UINT32_C(0x80000000))) 374 374 && (ASMCpuId_EDX(UINT32_C(0x80000001)) & X86_CPUID_EXT_FEATURE_EDX_RDTSCP) ) 375 375 { … … 406 406 idApic = UINT32_MAX; 407 407 uEax = ASMCpuId_EAX(0); 408 if (uEax >= UINT32_C(0xb) && ASMIsValidStdRange(uEax))408 if (uEax >= UINT32_C(0xb) && RTX86IsValidStdRange(uEax)) 409 409 { 410 410 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) … … 430 430 431 431 uEax = ASMCpuId_EAX(UINT32_C(0x80000000)); 432 if (uEax >= UINT32_C(0x8000001e) && ASMIsValidExtRange(uEax))432 if (uEax >= UINT32_C(0x8000001e) && RTX86IsValidExtRange(uEax)) 433 433 { 434 434 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) … … 1768 1768 { 1769 1769 uEAX = ASMCpuId_EAX(0x80000000); 1770 if ( ASMIsValidExtRange(uEAX) && uEAX >= 0x80000007)1770 if (RTX86IsValidExtRange(uEAX) && uEAX >= 0x80000007) 1771 1771 { 1772 1772 uEDX = ASMCpuId_EDX(0x80000007); … … 1814 1814 /* (2) If it's an AMD CPU with power management, we won't trust its TSC. */ 1815 1815 ASMCpuId(0, &uEAX, &uEBX, &uECX, &uEDX); 1816 if ( ASMIsValidStdRange(uEAX)1817 && ( ASMIsAmdCpuEx(uEBX, uECX, uEDX) || ASMIsHygonCpuEx(uEBX, uECX, uEDX)) )1816 if ( RTX86IsValidStdRange(uEAX) 1817 && (RTX86IsAmdCpu(uEBX, uECX, uEDX) || RTX86IsHygonCpu(uEBX, uECX, uEDX)) ) 1818 1818 { 1819 1819 /* Check for APM support. */ 1820 1820 uEAX = ASMCpuId_EAX(0x80000000); 1821 if ( ASMIsValidExtRange(uEAX) && uEAX >= 0x80000007)1821 if (RTX86IsValidExtRange(uEAX) && uEAX >= 0x80000007) 1822 1822 { 1823 1823 uEDX = ASMCpuId_EDX(0x80000007); … … 4033 4033 && pGip->cOnlineCpus > 2 4034 4034 && ASMHasCpuId() 4035 && ASMIsValidStdRange(ASMCpuId_EAX(0))4035 && RTX86IsValidStdRange(ASMCpuId_EAX(0)) 4036 4036 && (ASMCpuId_EDX(1) & X86_CPUID_FEATURE_EDX_HTT) 4037 4037 && ( !ASMIsAmdCpu() 4038 || ASMGetCpuFamily(u32Tmp = ASMCpuId_EAX(1)) > 0x154039 || ( ASMGetCpuFamily(u32Tmp) == 0x15 /* Piledriver+, not bulldozer (FX-4150 didn't like it). */4040 && ASMGetCpuModelAMD(u32Tmp) >= 0x02) ) )4038 || RTX86GetCpuFamily(u32Tmp = ASMCpuId_EAX(1)) > 0x15 4039 || ( RTX86GetCpuFamily(u32Tmp) == 0x15 /* Piledriver+, not bulldozer (FX-4150 didn't like it). */ 4040 && RTX86GetCpuModelAMD(u32Tmp) >= 0x02) ) ) 4041 4041 || !RTMpIsCpuOnline(idMaster) ) 4042 4042 { -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r93115 r93515 2008 2008 uint32_t uMaxId, uEAX, uEBX, uECX, uEDX; 2009 2009 ASMCpuId(0, &uMaxId, &uEBX, &uECX, &uEDX); 2010 if ( ASMIsValidStdRange(uMaxId)2010 if ( RTX86IsValidStdRange(uMaxId) 2011 2011 && uMaxId >= 0x00000007) 2012 2012 { -
trunk/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
r93239 r93515 840 840 if (!ASMHasCpuId()) 841 841 return false; 842 if (! ASMIsValidStdRange(ASMCpuId_EAX(0)))842 if (!RTX86IsValidStdRange(ASMCpuId_EAX(0))) 843 843 return false; 844 844 if (!(ASMCpuId_ECX(1) & X86_CPUID_FEATURE_ECX_HVP))
Note:
See TracChangeset
for help on using the changeset viewer.