Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73835 )
Change subject: soc/intel/xeon_sp/spr/cpu: add missing device_match_mask in CPU table ......................................................................
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 felix-coreboot@felixheld.de Change-Id: Ib0be2e9fe3c31487c83c9b1cf305a985416760b5 --- M src/soc/intel/xeon_sp/spr/cpu.c 1 file changed, 32 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/73835/1
diff --git a/src/soc/intel/xeon_sp/spr/cpu.c b/src/soc/intel/xeon_sp/spr/cpu.c index eb35f3e..47873f5 100644 --- a/src/soc/intel/xeon_sp/spr/cpu.c +++ b/src/soc/intel/xeon_sp/spr/cpu.c @@ -175,13 +175,13 @@ };
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 = {