From 6efc4aa4affd81b6c1cc54c99e8be0fb70051890 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 1 Sep 2021 12:40:47 +0530 Subject: [PATCH] arch/x86: Check unsupported CPU type while writing to SMBIOS table 7 Don't attempt to fill the SMBIOS table if the CPU doesn't support deterministic cache CPUID. TEST=Able to fix the hang issue seen on ASRock E350M1 with commit hash e2b5fee. Change-Id: Id65dc963e235f7080370a32cf69bcc4bee94d28f Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/57306 Reviewed-by: Angel Pons Reviewed-by: Tim Wawrzynczak Reviewed-by: Swift Geek (Sebastian Grzywna) Tested-by: build bot (Jenkins) --- src/arch/x86/smbios.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 0af149e6aa..71b6a22e4c 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -765,7 +765,8 @@ static int smbios_write_type7_cache_parameters(unsigned long *current, if (!cpu_have_cpuid()) return len; - if (cpu_check_deterministic_cache_cpuid_supported() == CPUID_TYPE_INVALID) { + enum cpu_type dcache_cpuid = cpu_check_deterministic_cache_cpuid_supported(); + if (dcache_cpuid == CPUID_TYPE_INVALID || dcache_cpuid == CPUID_COMMAND_UNSUPPORTED) { printk(BIOS_DEBUG, "SMBIOS: Unknown CPU\n"); return len; }