diff options
-rw-r--r-- | core/opal-dump.c | 8 | ||||
-rw-r--r-- | core/utils.c | 4 | ||||
-rw-r--r-- | hw/fsp/fsp-attn.c | 4 | ||||
-rw-r--r-- | hw/sbe-p9.c | 3 |
4 files changed, 8 insertions, 11 deletions
diff --git a/core/opal-dump.c b/core/opal-dump.c index ca6bf06..4f54a3e 100644 --- a/core/opal-dump.c +++ b/core/opal-dump.c @@ -489,13 +489,7 @@ static void post_mpipl_get_opal_data(void) void opal_mpipl_save_crashing_pir(void) { - struct dt_node *opal_node; - - opal_node = dt_find_by_path(dt_root, "ibm,opal"); - if (!opal_node) - return; - - if (!dt_find_by_path(opal_node, "dump")) + if (!is_mpipl_enabled()) return; mpipl_metadata->crashing_pir = this_cpu()->pir; diff --git a/core/utils.c b/core/utils.c index d778fcd..0d2f5e8 100644 --- a/core/utils.c +++ b/core/utils.c @@ -12,7 +12,6 @@ #include <processor.h> #include <cpu.h> #include <stack.h> -#include <opal-dump.h> void __noreturn assert_fail(const char *msg, const char *file, unsigned int line, const char *function) @@ -34,9 +33,6 @@ void __noreturn assert_fail(const char *msg, const char *file, prlog(PR_EMERG, "assert failed at %s:%u: %s\n", file, line, msg); backtrace(); - /* Save crashing CPU details */ - opal_mpipl_save_crashing_pir(); - if (platform.terminate) platform.terminate(msg); diff --git a/hw/fsp/fsp-attn.c b/hw/fsp/fsp-attn.c index 9d032d1..6e358e0 100644 --- a/hw/fsp/fsp-attn.c +++ b/hw/fsp/fsp-attn.c @@ -14,6 +14,7 @@ #include <hdata/spira.h> #include <stack.h> #include <processor.h> +#include <opal-dump.h> #define TI_CMD_VALID 0x1 /* Command valid */ #define TI_CMD 0xA1 /* Terminate Immediate command */ @@ -118,6 +119,9 @@ void __attribute__((noreturn)) ibm_fsp_terminate(const char *msg) /* Update op panel op_display */ op_display(OP_FATAL, OP_MOD_CORE, 0x6666); + /* Save crashing CPU details */ + opal_mpipl_save_crashing_pir(); + /* XXX FIXME: We should fsp_poll for a while to ensure any pending * console writes have made it out, but until we have decent PSI * link handling we must not do it forever. Polling can prevent the diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c index 24ed91b..ae5aacb 100644 --- a/hw/sbe-p9.c +++ b/hw/sbe-p9.c @@ -952,6 +952,9 @@ void p9_sbe_terminate(void) if (!is_mpipl_enabled()) return; + /* Save crashing CPU details */ + opal_mpipl_save_crashing_pir(); + /* Unregister flash. It will request BMC MBOX reset */ if (!flash_unregister()) { prlog(PR_DEBUG, "Failed to reset BMC MBOX\n"); |