From ddf48eb7c75687398d6a390bc21a50d74aef5df6 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 26 Oct 2022 10:09:00 +0200 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68892 Reviewed-by: Angel Pons Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) --- src/cpu/x86/mp_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index df6bc4bc87..a5d2ae6caa 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -201,6 +201,7 @@ static asmlinkage void ap_init(unsigned int index) /* 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 @@ static int allocate_cpu_devices(struct bus *cpu_bus, struct mp_params *p) continue; } new->name = processor_name; + new->enabled = 0; /* Runtime will enable it */ } return max_cpus;