summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/northbridge.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index f49d47dac9..80fba1de07 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -271,6 +271,12 @@ static void cpu_bus_scan(struct device *bus)
if (max_cpus < 0)
return;
+ /*
+ * Do not install more CPUs than supported by coreboot.
+ * This will cause a buffer overflow where fixed arrays of CONFIG_MAX_CPUS
+ * are used and might result in a boot failure.
+ */
+ max_cpus = MIN(max_cpus, CONFIG_MAX_CPUS);
/*
* TODO: This only handles the simple "qemu -smp $nr" case