aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2020-06-17 12:46:09 +0530
committerOliver O'Halloran <oohall@gmail.com>2020-06-30 12:07:23 +1000
commit9f5374b46aab4a2980d5bf745d79fa9d7bb609e1 (patch)
tree5f829a103e5bf2d6cc7815ece8b53fb673ab6d3b /core
parent53e4d7358c8f28f0338cad20ce6aac425b22da4c (diff)
downloadskiboot-9f5374b46aab4a2980d5bf745d79fa9d7bb609e1.zip
skiboot-9f5374b46aab4a2980d5bf745d79fa9d7bb609e1.tar.gz
skiboot-9f5374b46aab4a2980d5bf745d79fa9d7bb609e1.tar.bz2
mpipl: Delay MPIPL registration until OPAL init is complete
If OPAL boot fails after MPIPL init (opal_mpipl_init()) then we call MPIPL boot instead of reboot. BMC is not aware of MPIPL. Hence it may result in continuous MPIPL loop (boot -> crash -> MPIPL -> boot). If OPAL boot fails (before loading kernel) then its better to call reboot. So that BMC can detect `n` number of boot failures (generally n = 3) and stop booting. That way we can avoid continuous loop. This patch moves MPIPL init to the end of init process (just before starting kernel). So that if we fail to boot OPAL we call normal reboot. Also this patch introduces new function to detect MPIPL is enabled or not (is_mpipl_enabled()). And in assert() path we check for this function instead of `dump` DT node. So that it will make sure we will not call MPIPL until opal_mpipl_init is complete. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/init.c7
-rw-r--r--core/opal-dump.c10
2 files changed, 14 insertions, 3 deletions
diff --git a/core/init.c b/core/init.c
index 07e3092..d82eebe 100644
--- a/core/init.c
+++ b/core/init.c
@@ -635,6 +635,10 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
patch_traps(false);
cpu_set_hile_mode(false); /* Clear HILE on all CPUs */
+ /* init MPIPL */
+ if (!is_reboot)
+ opal_mpipl_init();
+
checksum_romem();
debug_descriptor.state_flags |= OPAL_BOOT_COMPLETE;
@@ -1363,9 +1367,6 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
/* Create the LPC bus interrupt-map on P9 */
lpc_finalize_interrupts();
- /* init opal dump */
- opal_mpipl_init();
-
/* Add the list of interrupts going to OPAL */
add_opal_interrupts();
diff --git a/core/opal-dump.c b/core/opal-dump.c
index a31ecbe..ca6bf06 100644
--- a/core/opal-dump.c
+++ b/core/opal-dump.c
@@ -67,6 +67,8 @@ static int opal_mpipl_max_tags = MAX_OPAL_MPIPL_TAGS;
static u64 opal_dump_addr, opal_dump_size;
+static bool mpipl_enabled;
+
static int opal_mpipl_add_entry(u8 region, u64 src, u64 dest, u64 size)
{
int i;
@@ -526,6 +528,11 @@ void opal_mpipl_reserve_mem(void)
arch_regs_dest, arch_regs_size);
}
+bool is_mpipl_enabled(void)
+{
+ return mpipl_enabled;
+}
+
void opal_mpipl_init(void)
{
void *mdst_base = (void *)MDST_TABLE_BASE;
@@ -575,4 +582,7 @@ void opal_mpipl_init(void)
opal_register(OPAL_MPIPL_UPDATE, opal_mpipl_update, 4);
opal_register(OPAL_MPIPL_REGISTER_TAG, opal_mpipl_register_tag, 2);
opal_register(OPAL_MPIPL_QUERY_TAG, opal_mpipl_query_tag, 2);
+
+ /* Enable MPIPL */
+ mpipl_enabled = true;
}