[Skiboot] [PATCH v4] IPMI: Trigger OPAL TI in abort path.

Mahesh Salgaonkar mahesh at linux.vnet.ibm.com
Tue Nov 5 21:45:18 AEDT 2019

The current assert/abort implementation for BMC based system invokes cec
reboot after printing backtrace. This means that BMC never gets notified
about OPAL crash/termination. This sometimes leads into never ending
IPL-ing loop if OPAL keeps aborting very early in boot path.

Trigger a software xstop (OPAL TI) to inform BMC about the OPAL
termination. BMC is capable of catching checkstop signal and facilitate in
rebooting (IPL-ing) host.

With AutoReboot policy, OpenBMC handles checkstop signals and counts them
against the reboot counter. In cases where OPAL is crashing before host
reaches to runtime, OpenBMC will move the system in Quiesced state after 3
or so attempts of IPL/reboot so that system can be debugged. When OPAL
triggers software checkstop it causes all the CPU threads to be stooped and
moved to quiesced state. Hence OPAL don't need to explicitly stop all CPUs
before calling software xstop.

Signed-off-by: Mahesh Salgaonkar <mahesh at linux.vnet.ibm.com>
 - Remove the unwanted header file include leftover from v2.
 - Trigger software xstop (OPAL TI) instead of attn.
 - Always Quiesce the secondaries in abort path.
 - Change the attn_supported type to bool.
 hw/ipmi/ipmi-attn.c |   30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/hw/ipmi/ipmi-attn.c b/hw/ipmi/ipmi-attn.c
index 3a615189d..93ede0510 100644
--- a/hw/ipmi/ipmi-attn.c
+++ b/hw/ipmi/ipmi-attn.c
@@ -14,6 +14,7 @@
 #include <skiboot.h>
 #include <stack.h>
 #include <timebase.h>
+#include <xscom.h>
 /* Use same attention SRC for BMC based machine */
@@ -67,18 +68,33 @@ void __attribute__((noreturn)) ipmi_terminate(const char *msg)
-	/* Terminate called before initializing IPMI (early abort) */
-	if (!ipmi_present()) {
-		if (platform.cec_reboot)
-			platform.cec_reboot();
-		goto out;
-	}
+	/*
+	 * Trigger software xstop (OPAL TI). It will stop all the CPU threads
+	 * moving them into quiesced state. OCC will collect all FIR data.
+	 * Upon checkstop signal, BMC will then decide whether to reboot/IPL or
+	 * not depending on AutoReboot policy, if any. This helps in cases
+	 * where OPAL is crashing/terminating before host reaches to runtime.
+	 * With OpenBMC AutoReboot policy, in such cases, it will make sure
+	 * that system is moved to Quiesced state after 3 or so attempts to
+	 * IPL.  Without OPAL TI, OpenBMC will never know that OPAL is
+	 * terminating and system would go into never ending IPL'ing loop.
+	 *
+	 * Once the system reaches to runtime, OpenBMC resets the boot counter.
+	 * Hence next time when BMC receieves the OPAL TI, it will IPL the
+	 * system if AutoReboot is enabled. We don't need to worry about self
+	 * rebooting.
+	 */
+	xscom_trigger_xstop();
+	/*
+	 * Control will not reach here if software xstop has been supported and
+	 * enabled. If not supported then fallback to cec reboot path below.
+	 */
 	/* Reboot call */
 	if (platform.cec_reboot)
 	while (1)

More information about the Skiboot mailing list