Skip to content

Commit

Permalink
MPIPL: Save crashing PIR
Browse files Browse the repository at this point in the history
Crashing CPU PIR is required to get proper backtrace from core file.
Save crashing CPU PIR before triggering MPIPL. Post MPIPL OPAL will
pass saved PIR to kernel and kernel will use that to create OPAL dump.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
[oliver: rebased]
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
Vasant Hegde authored and oohal committed Aug 15, 2019
1 parent 0a17e67 commit fbd875d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/opal-dump.c
Expand Up @@ -16,6 +16,7 @@

#define pr_fmt(fmt) "DUMP: " fmt

#include <cpu.h>
#include <device.h>
#include <mem-map.h>
#include <mem_region.h>
Expand Down Expand Up @@ -328,6 +329,12 @@ static int64_t opal_mpipl_register_tag(enum opal_mpipl_tags tag,
return rc;
}

void opal_mpipl_save_crashing_pir(void)
{
mpipl_metadata->crashing_pir = this_cpu()->pir;
prlog(PR_NOTICE, "Crashing PIR = 0x%x\n", this_cpu()->pir);
}

void opal_mpipl_init(void)
{
void *mdst_base = (void *)MDST_TABLE_BASE;
Expand Down
4 changes: 4 additions & 0 deletions hw/sbe-p9.c
Expand Up @@ -40,6 +40,7 @@
#include <errorlog.h>
#include <lock.h>
#include <opal.h>
#include <opal-dump.h>
#include <sbe-p9.h>
#include <skiboot.h>
#include <timebase.h>
Expand Down Expand Up @@ -951,6 +952,9 @@ void p9_sbe_terminate(void)
if (!dt_find_by_path(opal_node, "dump"))
return;

/* Save crashing CPU details */
opal_mpipl_save_crashing_pir();

/*
* Send S0 interrupt to all SBE. Sequence:
* - S0 interrupt on secondary chip SBE
Expand Down
3 changes: 3 additions & 0 deletions include/opal-dump.h
Expand Up @@ -121,4 +121,7 @@ struct mpipl_metadata {
/* init opal dump */
extern void opal_mpipl_init(void);

/* Save metadata before triggering MPIPL */
void opal_mpipl_save_crashing_pir(void);

#endif /* __OPAL_DUMP_H */

0 comments on commit fbd875d

Please sign in to comment.