arch/x86/cpu_common: use cpuid_e[a,c]x

Use cpuid_eax and cpuid_ecx instead of sort-of open-coding the same
functionality in cpu_check_deterministic_cache_cpuid_supported.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ib0dc2be4f602bf63183b9096e38403ae2f45d959
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78058
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held 2023-09-21 20:34:43 +02:00
parent 9acae39bc2
commit 1d466f2a75
1 changed files with 2 additions and 6 deletions

View File

@ -89,19 +89,15 @@ uint32_t cpu_get_feature_flags_edx(void)
enum cpu_type cpu_check_deterministic_cache_cpuid_supported(void)
{
struct cpuid_result res;
if (cpu_is_intel()) {
res = cpuid(0);
if (res.eax < 4)
if (cpuid_eax(0) < 4)
return CPUID_COMMAND_UNSUPPORTED;
return CPUID_TYPE_INTEL;
} else if (cpu_is_amd()) {
if (cpu_cpuid_extended_level() < 0x80000001)
return CPUID_COMMAND_UNSUPPORTED;
res = cpuid(0x80000001);
if (!(res.ecx & (1 << 22)))
if (!(cpuid_ecx(0x80000001) & (1 << 22)))
return CPUID_COMMAND_UNSUPPORTED;
return CPUID_TYPE_AMD;