soc/intel/xeon_sp/spr/cpu: add missing device_match_mask in CPU table

Commit 6a6ac1e0b9 ("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 3ed903fda9 ("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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73835
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
This commit is contained in:
Felix Held 2023-03-20 22:22:54 +01:00
parent 08391d2f5f
commit 7561360e72
1 changed files with 7 additions and 7 deletions

View File

@ -175,13 +175,13 @@ static struct device_operations cpu_dev_ops = {
}; };
static const struct cpu_device_id cpu_table[] = { static const struct cpu_device_id cpu_table[] = {
{X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_D}, {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_D, CPUID_EXACT_MATCH_MASK},
{X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E0}, {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E0, CPUID_EXACT_MATCH_MASK},
{X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E2}, {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E2, CPUID_EXACT_MATCH_MASK},
{X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E3}, {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E3, CPUID_EXACT_MATCH_MASK},
{X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E4}, {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_E4, CPUID_EXACT_MATCH_MASK},
{X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_Ex}, {X86_VENDOR_INTEL, CPUID_SAPPHIRERAPIDS_SP_Ex, CPUID_EXACT_MATCH_MASK},
{0, 0}, CPU_TABLE_END
}; };
static const struct cpu_driver driver __cpu_driver = { static const struct cpu_driver driver __cpu_driver = {