summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-09-21 20:34:43 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-09-23 01:22:14 +0000
commit1d466f2a75854eaffab0f33cf024bd9e8029104d (patch)
treebb6a0c2240670f402408f47b876c2a434233cf78
parent9acae39bc22a53689cab9311e26b6ed248cedd58 (diff)
downloadcoreboot-1d466f2a75854eaffab0f33cf024bd9e8029104d.tar.gz
coreboot-1d466f2a75854eaffab0f33cf024bd9e8029104d.tar.bz2
coreboot-1d466f2a75854eaffab0f33cf024bd9e8029104d.zip
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>
-rw-r--r--src/arch/x86/cpu_common.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/arch/x86/cpu_common.c b/src/arch/x86/cpu_common.c
index 102ccf046875..9727d645286f 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;