coreboot/src/soc/intel
Jeremy Compostella ba7a9eefcf soc/intel/common: Fix invalid MADT entries creation
commit f8ac3dda02 ("soc/intel/common:
Order the CPUs based on their APIC IDs") sort algorithnm walks all the
`cpu_info' entries without discarding empty ones.  Since `cpu_info' is
not initialized, the data that is used is undefined and it generally
results in the creation of invalid `Local x2APIC' entries in the
MADT ("APIC") ACPI table.

Depending on the X2APIC ID value the Linux kernel behavior
changes (cf. arch/x86/kernel/acpi/boot.c::acpi_register_lapic()):
1. If (int)ID >= MAX_LOCAL_APIC (32768), the Linux kernel discards the
   entry with the "skipped apicid that is too big" INFO level
   message.
2. If (int)ID < MAX_LOCAL_APIC (32768) (including negative) this data
   is taken into account and it can lead to undesirable behavior such
   as core being disabled as (cf. "native_cpu_up: bad cpu" ERROR
   kernel message).

TEST=Verified the MADT does not contain any invalid entries on rex.

Change-Id: I19c7aa51f232bf48201bd6d28f108e9120a21f7e
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77615
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
2023-09-12 16:08:57 +00:00
..
alderlake cpu/intel: Move is_tme_supported() from soc/intel to cpu/intel 2023-09-12 08:11:17 +00:00
apollolake soc/intel/apollolake: Correct the logic for the legacy 8254 timer 2023-08-25 14:38:31 +00:00
baytrail soc/intel: Remove space between function name and '(' 2023-09-11 21:39:08 +00:00
braswell soc: Remove SOC_SPECIFIC_OPTIONS 2023-08-21 23:45:43 +00:00
broadwell soc/intel: Remove space between function name and '(' 2023-09-11 21:39:08 +00:00
cannonlake soc/intel/cannonlake/Kconfig: Deduplicate selections 2023-09-02 01:42:44 +00:00
common soc/intel/common: Fix invalid MADT entries creation 2023-09-12 16:08:57 +00:00
denverton_ns soc: Remove SOC_SPECIFIC_OPTIONS 2023-08-21 23:45:43 +00:00
elkhartlake soc: Remove SOC_SPECIFIC_OPTIONS 2023-08-21 23:45:43 +00:00
jasperlake soc/intel/{adl,jsl,mtl,tgl}: Add ACPI name for GNA device 2023-09-01 21:26:47 +00:00
meteorlake cpu/intel: Move is_tme_supported() from soc/intel to cpu/intel 2023-09-12 08:11:17 +00:00
skylake ACPI: Add helper fill_fadt_extended_pm_io() 2023-08-08 06:51:03 +00:00
tigerlake cpu/intel: Move is_tme_supported() from soc/intel to cpu/intel 2023-09-12 08:11:17 +00:00
xeon_sp {drivers/intel/fsp2_0, soc/intel}: Rename SAVE_MRC_AFTER_FSPS config 2023-09-04 05:37:15 +00:00
Makefile.inc