From 7561360e7246ead88a299b91e141fce76b9fee66 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 20 Mar 2023 22:22:54 +0100 Subject: soc/intel/xeon_sp/spr/cpu: add missing device_match_mask in CPU table Commit 6a6ac1e0b929 ("arch/x86/cpu: introduce and use device_match_mask") added the device_match_mask element to the cpu_device_id struct and uses it to be able to mask off for example the stepping ID when checking for CPU table entry that matches the silicon the code is running on. Commit 3ed903fda9cb ("soc/intel/xeon_sp/spr: Add Sapphire Rapids ramstage code") added a CPU table that was missing the device_match_mask which results in this being 0, so the first entry of the CPU table would match for any Intel CPU which isn't the intended behavior. Also use CPU_TABLE_END instead of the final {0, 0, 0} array element. Likely all entries could be replaced by one entry that uses the CPUID_ALL_STEPPINGS_MASK instead of the CPUID_EXACT_MATCH_MASK, but that's out of scope for this fix. Signed-off-by: Felix Held Change-Id: Ib0be2e9fe3c31487c83c9b1cf305a985416760b5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73835 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Lean Sheng Tan --- src/soc/intel/xeon_sp/spr/cpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/soc/intel/xeon_sp/spr/cpu.c b/src/soc/intel/xeon_sp/spr/cpu.c index eb35f3e3c8..47873f5300 100644 --- a/src/soc/intel/xeon_sp/spr/cpu.c +++ b/src/soc/intel/xeon_sp/spr/cpu.c @@ -175,13 +175,13 @@ static struct device_operations cpu_dev_ops = { }; static const struct cpu_device_id cpu_table[] = { - {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_D}, - {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E0}, - {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E2}, - {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E3}, - {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E4}, - {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_Ex}, - {0, 0}, + {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_D, CPUID_EXACT_MATCH_MASK}, + {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E0, CPUID_EXACT_MATCH_MASK}, + {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E2, CPUID_EXACT_MATCH_MASK}, + {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E3, CPUID_EXACT_MATCH_MASK}, + {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E4, CPUID_EXACT_MATCH_MASK}, + {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_Ex, CPUID_EXACT_MATCH_MASK}, + CPU_TABLE_END }; static const struct cpu_driver driver __cpu_driver = { -- cgit v1.2.3