Skip to content

Commit

Permalink
soc/intel/common/block/acpi: Skip generatic LAPIC entries for non-exi…
Browse files Browse the repository at this point in the history
…sting CPUs

MADT LAPIC entries were generated for all CPUs in range 0 to
CONFIG_MAX_CPUS regardless of their existence. This caused the
cpu->path.apic.core_type field to have a different value than specified
in cpu_perf_eff_type enum and extra efficient cores being added to the
list with an unusuallly high APIC ID dereferenced from NULL pointer.
For systems which obtain LAPICs/CPUs topology from MADT, like ESXI, it
resulted in finding more CPUs than available in the system (exactly one
more core in case of ESXi, because other entries had the same ACPI ID
and were ignored as duplicates). SMP initialization failed in such case
with timeout on waking a non-existent CPU core.

TEST=Boot ESXi in headless mode on VP6670.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
  • Loading branch information
miczyg1 committed Jul 25, 2024
1 parent 6e536e3 commit 12676bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/soc/intel/common/block/acpi/cpu_hybrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ static void acpi_set_hybrid_cpu_apicid_order(void *unused)
uint32_t i, j = 0;

for (i = 0; i < ARRAY_SIZE(cpu_apic_info.apic_ids); i++) {
if (!cpu_infos[i].cpu)
continue;

if (cpu_infos[i].cpu->path.apic.core_type == CPU_TYPE_PERF)
cpu_apic_info.apic_ids[perf_core_cnt++] =
cpu_infos[i].cpu->path.apic.apic_id;
Expand Down

0 comments on commit 12676bd

Please sign in to comment.