cpu/mp_init.c: Only enable CPUs once they execute code
On some systems the BSP cannot know how many CPUs are present in the
system. A typical use case is a multi socket system. Setting the enable
flag only on CPUs that actually exist makes it more flexible.
Change-Id: I6c8042b4d6127239175924f996f735bf9c83c6e8
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68892
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index df6bc4b..a5d2ae6 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -201,6 +201,7 @@
/* Fix up APIC id with reality. */
dev->path.apic.apic_id = lapicid();
dev->path.apic.initial_lapicid = initial_lapicid();
+ dev->enabled = 1;
if (cpu_is_intel())
printk(BIOS_INFO, "AP: slot %u apic_id %x, MCU rev: 0x%08x\n", index,
@@ -387,6 +388,7 @@
continue;
}
new->name = processor_name;
+ new->enabled = 0; /* Runtime will enable it */
}
return max_cpus;