Attention is currently required from: Arthur Heymans, Jérémy Compostella, Subrata Banik, Sukumar Ghorai, sridhar siricilla.

Jérémy Compostella uploaded patch set #4 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+1 by Sukumar Ghorai, Verified+1 by build bot (Jenkins)

soc/intel/common: Fix invalid MADT entries creation

commit b793aa3bca5a3f8a6c4ef5a28925a1aeebf426c8 ("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>
---
M src/arch/x86/cpu.c
M src/soc/intel/common/block/acpi/cpu_hybrid.c
2 files changed, 3 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/77615/4

To view, visit change 77615. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I19c7aa51f232bf48201bd6d28f108e9120a21f7e
Gerrit-Change-Number: 77615
Gerrit-PatchSet: 4
Gerrit-Owner: Jérémy Compostella <jeremy.compostella@intel.com>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Subrata Banik <subratabanik@google.com>
Gerrit-Reviewer: Sukumar Ghorai <sukumar.ghorai@intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Reviewer: sridhar siricilla <sridhar.siricilla@intel.com>
Gerrit-Attention: Subrata Banik <subratabanik@google.com>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella@intel.com>
Gerrit-Attention: sridhar siricilla <sridhar.siricilla@intel.com>
Gerrit-Attention: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Attention: Sukumar Ghorai <sukumar.ghorai@intel.com>
Gerrit-MessageType: newpatchset