mambo: disable OPAL_SIGNAL_SYSTEM_RESET

Message ID 20171017053542.7924-1-npiggin@gmail.com
State New
Headers show
Series
  • mambo: disable OPAL_SIGNAL_SYSTEM_RESET
Related show

Commit Message

Nicholas Piggin Oct. 17, 2017, 5:35 a.m.
mambo does not deliver system reset interrupts correctly (details in
the added comment), so disable it for now.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
--

This feature was useful for developing the NMI IPI system in Linux,
but now it's somewhat working, and we've got OPAL_SIGNAL_SYSTEM_RESET
implemented on real hardware (and equivalent hypercall for QEMU
guests), it is less important now. It's annoing because it causes
breaking to xmon to usually often crash the kernel in an SMP sim.
---
 platforms/mambo/mambo.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

Patch

diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c
index cb6e103c..8afd01c2 100644
--- a/platforms/mambo/mambo.c
+++ b/platforms/mambo/mambo.c
@@ -259,7 +259,22 @@  static int64_t mambo_signal_system_reset(int32_t cpu_nr)
 
 static void mambo_sreset_init(void)
 {
-	opal_register(OPAL_SIGNAL_SYSTEM_RESET, mambo_signal_system_reset, 1);
+	/*
+	 * Mambo currently does not deliver system reset interrupts
+	 * correctly if the CPU was in idle state. The expected
+	 * behavior (and what the hardware does) is to set SRR1 to a
+	 * power save wakeup, with wakeup reason system reset. This
+	 * allows CPU state to be restored and then the system reset
+	 * interrupt to be taken.
+	 *
+	 * Mambo does a non-power-saving wakeup, which immediately
+	 * crashes if MSR[RI] is clear as part of the idle entry sequence.
+	 *
+	 * Disable this for now until mambo can be fixed, or a workaround
+	 * put in the tcl injection.
+	 */
+	if (0)
+		opal_register(OPAL_SIGNAL_SYSTEM_RESET, mambo_signal_system_reset, 1);
 }
 
 static void mambo_platform_init(void)