aboutsummaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2021-10-20 23:31:43 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-10-22 01:27:07 +0000
commit4dd7d1196545f1dff71b8e70b7a9b80b8bcd4041 (patch)
tree6a0c12d1d086f89d7ba7369247298a1ccde2faab /src/cpu
parent82faefb339a0853dd49f10bafd2c4f5ca1723fb3 (diff)
cpu/x86/mp_init: move printing of failure message into mp_init_with_smm
Each CPU/SoC checks the return value of the mp_init_with_smm and prints the same error message if it wasn't successful, so move this check and printk to mp_init_with_smm. For this the original mp_init_with_smm function gets renamed to do_mp_init_with_smm and a new mp_init_with_smm function is created which then calls do_mp_init_with_smm, prints the error if it didn't return CB_SUCCESS and passes the return value of do_mp_init_with_smm to its caller. Since no CPU/SoC code handles a mp_init_with_smm failure apart from printing a message, also add a comment at the mp_init_with_smm call sites that the code might want to handle a failure. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I181602723c204f3e43eb43302921adf7a88c81ed Reviewed-on: https://review.coreboot.org/c/coreboot/+/58498 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/intel/haswell/haswell_init.c4
-rw-r--r--src/cpu/intel/model_1067x/mp_init.c4
-rw-r--r--src/cpu/intel/model_2065x/model_2065x_init.c4
-rw-r--r--src/cpu/intel/model_206ax/model_206ax_init.c4
-rw-r--r--src/cpu/x86/mp_init.c12
5 files changed, 19 insertions, 9 deletions
diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c
index 40f5ce0013..2ab77b3044 100644
--- a/src/cpu/intel/haswell/haswell_init.c
+++ b/src/cpu/intel/haswell/haswell_init.c
@@ -642,8 +642,8 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
- if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
- printk(BIOS_ERR, "MP initialization failure.\n");
+ /* TODO: Handle mp_init_with_smm failure? */
+ mp_init_with_smm(cpu_bus, &mp_ops);
}
static struct device_operations cpu_dev_ops = {
diff --git a/src/cpu/intel/model_1067x/mp_init.c b/src/cpu/intel/model_1067x/mp_init.c
index 38d3735f14..9a1fc42d3e 100644
--- a/src/cpu/intel/model_1067x/mp_init.c
+++ b/src/cpu/intel/model_1067x/mp_init.c
@@ -98,6 +98,6 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
- if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
- printk(BIOS_ERR, "MP initialization failure.\n");
+ /* TODO: Handle mp_init_with_smm failure? */
+ mp_init_with_smm(cpu_bus, &mp_ops);
}
diff --git a/src/cpu/intel/model_2065x/model_2065x_init.c b/src/cpu/intel/model_2065x/model_2065x_init.c
index a31f2cb692..30519c0256 100644
--- a/src/cpu/intel/model_2065x/model_2065x_init.c
+++ b/src/cpu/intel/model_2065x/model_2065x_init.c
@@ -175,8 +175,8 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
- if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
- printk(BIOS_ERR, "MP initialization failure.\n");
+ /* TODO: Handle mp_init_with_smm failure? */
+ mp_init_with_smm(cpu_bus, &mp_ops);
}
static struct device_operations cpu_dev_ops = {
diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c
index f3181cfaa6..d240f53761 100644
--- a/src/cpu/intel/model_206ax/model_206ax_init.c
+++ b/src/cpu/intel/model_206ax/model_206ax_init.c
@@ -431,8 +431,8 @@ static const struct mp_ops mp_ops = {
void mp_init_cpus(struct bus *cpu_bus)
{
- if (mp_init_with_smm(cpu_bus, &mp_ops) != CB_SUCCESS)
- printk(BIOS_ERR, "MP initialization failure.\n");
+ /* TODO: Handle mp_init_with_smm failure? */
+ mp_init_with_smm(cpu_bus, &mp_ops);
}
static struct device_operations cpu_dev_ops = {
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index 0624176b75..c99732fb39 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -1095,7 +1095,7 @@ static void fill_mp_state(struct mp_state *state, const struct mp_ops *ops)
mp_state.ops.per_cpu_smm_trigger = smm_initiate_relocation;
}
-enum cb_err mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops)
+static enum cb_err do_mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops)
{
enum cb_err ret;
void *default_smm_area;
@@ -1142,3 +1142,13 @@ enum cb_err mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops)
return ret;
}
+
+enum cb_err mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops)
+{
+ enum cb_err ret = do_mp_init_with_smm(cpu_bus, mp_ops);
+
+ if (ret != CB_SUCCESS)
+ printk(BIOS_ERR, "MP initialization failure.\n");
+
+ return ret;
+}