Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/of: Don't use DTB for SMP setup if ACPI is enabled

There are cases when it is useful to use both ACPI and DTB provided by
the bootloader, however in such cases we should make sure to prevent
conflicts between the two. Namely, don't try to use DTB for SMP setup
if ACPI is enabled.

Precisely, this prevents at least:

- incorrectly calling register_lapic_address(APIC_DEFAULT_PHYS_BASE)
after the LAPIC was already successfully enumerated via ACPI, causing
noisy kernel warnings and probably potential real issues as well

- failed IOAPIC setup in the case when IOAPIC is enumerated via mptable
instead of ACPI (e.g. with acpi=noirq), due to
mpparse_parse_smp_config() overridden by x86_dtb_parse_smp_config()

Signed-off-by: Dmytro Maluka <dmaluka@chromium.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250105172741.3476758-2-dmaluka@chromium.org

authored by

Dmytro Maluka and committed by
Ingo Molnar
96f41f64 d082ecbc

+2 -1
+2 -1
arch/x86/kernel/devicetree.c
··· 2 2 /* 3 3 * Architecture specific OF callbacks. 4 4 */ 5 + #include <linux/acpi.h> 5 6 #include <linux/export.h> 6 7 #include <linux/io.h> 7 8 #include <linux/interrupt.h> ··· 314 313 if (initial_dtb) 315 314 early_memunmap(dt, map_len); 316 315 #endif 317 - if (of_have_populated_dt()) 316 + if (acpi_disabled && of_have_populated_dt()) 318 317 x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config; 319 318 }