From 1eea841b29643b2a6b1d08ec81a6ae9a71ef3166 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Sat, 23 Sep 2023 03:44:02 +0200 Subject: [PATCH] arch/x86/smbios: fix extended CPUID level check logic Before the cpuid(0x80000001) read in smbios_write_type4, it was previously checked in a slightly convoluted way if the result from cpu_cpuid_extended_level was larger than 0x80000001, but the check should be if it is larger or equal to 0x80000001. Signed-off-by: Felix Held Change-Id: Iabcfdb2b8b90d80baf8f4c4d2fd79f1f44866dc7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78107 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/arch/x86/smbios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 6f0d35e1a3..a2038b6dea 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -182,7 +182,7 @@ int smbios_write_type4(unsigned long *current, int handle) if ((res.edx) & BIT(28)) characteristics |= BIT(4); /* BIT4: Hardware Thread */ - if (((cpu_cpuid_extended_level() - 0x80000000) + 1) > 2) { + if (cpu_cpuid_extended_level() >= 0x80000001) { res = cpuid(0x80000001); if ((res.edx) & BIT(20))