diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2022-11-01 20:02:44 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-11-03 21:38:26 +0000 |
commit | d1862b4e88ebdde3cd7141a4b2e838abedbff688 (patch) | |
tree | 2103f626f68e304b873d2844ec95b1ef8e2fa757 /src/cpu | |
parent | 1bb9786da30e77014c806a40da0ffdf4c860c185 (diff) |
cpu/x86/mp_init.c: Handle failed init_bsp()
Bail out of mp_init if this function fails.
Change-Id: I7be5d6c32458ba98f4f8c5c9340790ff989c91e7
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69109
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/x86/mp_init.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 8cd785e5ec..fa19104b53 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -532,7 +532,7 @@ static enum cb_err bsp_do_flight_plan(struct mp_params *mp_params) return ret; } -static void init_bsp(struct bus *cpu_bus) +static enum cb_err init_bsp(struct bus *cpu_bus) { struct device_path cpu_path; struct cpu_info *info; @@ -554,11 +554,14 @@ static void init_bsp(struct bus *cpu_bus) info->cpu = alloc_find_dev(cpu_bus, &cpu_path); info->cpu->name = processor_name; - if (info->index != 0) + if (info->index != 0) { printk(BIOS_CRIT, "BSP index(%zd) != 0!\n", info->index); + return CB_ERR; + } /* Track BSP in cpu_map structures. */ cpu_add_map_entry(info->index); + return CB_SUCCESS; } /* @@ -585,7 +588,10 @@ static enum cb_err mp_init(struct bus *cpu_bus, struct mp_params *p) g_cpu_bus = cpu_bus; - init_bsp(cpu_bus); + if (init_bsp(cpu_bus) != CB_SUCCESS) { + printk(BIOS_CRIT, "Setting up BSP failed\n"); + return CB_ERR; + } if (p == NULL || p->flight_plan == NULL || p->num_records < 1) { printk(BIOS_CRIT, "Invalid MP parameters\n"); |