From 1d466f2a75854eaffab0f33cf024bd9e8029104d Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 21 Sep 2023 20:34:43 +0200 Subject: [PATCH] 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 Change-Id: Ib0dc2be4f602bf63183b9096e38403ae2f45d959 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78058 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/arch/x86/cpu_common.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/arch/x86/cpu_common.c b/src/arch/x86/cpu_common.c index 102ccf0468..9727d64528 100644 --- a/src/arch/x86/cpu_common.c +++ b/src/arch/x86/cpu_common.c @@ -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;