Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48210 )
Change subject: mb/emulation/x86: Add optional parallel_mp init support ......................................................................
mb/emulation/x86: Add optional parallel_mp init support
This makes it possible to select both the legacy LAPIC AP init or the newer parallel MP init.
Tested on i440fx with -smp 32. Note does not work on x86_64!
Change-Id: I007b052ccd3c34648cd172344d55768232acfd88 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/qemu-x86/Kconfig M src/mainboard/emulation/qemu-i440fx/northbridge.c 2 files changed, 29 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/48210/1
diff --git a/src/cpu/qemu-x86/Kconfig b/src/cpu/qemu-x86/Kconfig index 06d0ba8..c92bdf2 100644 --- a/src/cpu/qemu-x86/Kconfig +++ b/src/cpu/qemu-x86/Kconfig @@ -9,6 +9,19 @@ if CPU_QEMU_X86
choice + prompt "AP init" + default CPU_QEMU_X86_LAPIC_INIT + +config CPU_QEMU_X86_LAPIC_INIT + bool "Legacy serial LAPIC init" + +config CPU_QEMU_X86_PARALLEL_MP + bool "Parallel MP init" + select PARALLEL_MP + +endchoice + +choice prompt "SMM support" default CPU_QEMU_X86_ASEG_SMM
@@ -18,6 +31,7 @@
config CPU_QEMU_X86_ASEG_SMM bool "SMM ASEG" + depends on !PARALLEL_MP select SMM_ASEG
#config CPU_QEMU_X86_TSEG_SMM diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c index d19d6c8..f49d47da 100644 --- a/src/mainboard/emulation/qemu-i440fx/northbridge.c +++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c @@ -3,6 +3,7 @@ #include <console/console.h> #include <cpu/cpu.h> #include <cpu/x86/lapic_def.h> +#include <cpu/x86/mp.h> #include <arch/io.h> #include <device/pci_def.h> #include <device/pci_ops.h> @@ -244,9 +245,22 @@ #endif };
+static const struct mp_ops mp_ops_no_smm = { + .get_cpu_count = fw_cfg_max_cpus, +}; + +void mp_init_cpus(struct bus *cpu_bus) +{ + if (mp_init_with_smm(cpu_bus, &mp_ops_no_smm)) + printk(BIOS_ERR, "MP initialization failure.\n"); +} + static void cpu_bus_init(struct device *dev) { - initialize_cpus(dev->link_list); + if (CONFIG(PARALLEL_MP)) + mp_cpu_bus_init(dev); + else + initialize_cpus(dev->link_list); }
static void cpu_bus_scan(struct device *bus)