Arthur Heymans has uploaded this change for review.

View Change

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>
---
M src/cpu/x86/mp_init.c
1 file changed, 21 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/69109/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index d698634..d05dc44 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -531,7 +531,7 @@
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;
@@ -553,11 +553,14 @@
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;
}

/*
@@ -584,7 +587,10 @@

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");

To view, visit change 69109. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7be5d6c32458ba98f4f8c5c9340790ff989c91e7
Gerrit-Change-Number: 69109
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-MessageType: newchange