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(-)

Comments

Stewart Smith July 26, 2018, 8:03 a.m. | #1
Nicholas Piggin <npiggin@gmail.com> writes:
> 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.

(looking back at patches I've neglected in patchwork as I have a notmuch
query for that now)

I'm interested in another alternative as we do have stupid unittests for
part of this code that is nice to have work.

I guess we could look at what idle states are enabled, and for the unit
tests, just enable none of them?
Nicholas Piggin Aug. 1, 2018, 2:52 a.m. | #2
On Thu, 26 Jul 2018 18:03:50 +1000
Stewart Smith <stewart@linux.ibm.com> wrote:

> Nicholas Piggin <npiggin@gmail.com> writes:
> > 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.  
> 
> (looking back at patches I've neglected in patchwork as I have a notmuch
> query for that now)
> 
> I'm interested in another alternative as we do have stupid unittests for
> part of this code that is nice to have work.
> 
> I guess we could look at what idle states are enabled, and for the unit
> tests, just enable none of them?
> 

Yeah that could work for unit tests. One day if we get mambo fixed we
could turn it back on too. I'll have to get back to looking at that,
but I've had enough system reset problems for the moment :) The mambo
devs are busy with other things too I think.

Thanks,
Nick
Stewart Smith Aug. 1, 2018, 5:03 a.m. | #3
Nicholas Piggin <npiggin@gmail.com> writes:
> On Thu, 26 Jul 2018 18:03:50 +1000
> Stewart Smith <stewart@linux.ibm.com> wrote:
>
>> Nicholas Piggin <npiggin@gmail.com> writes:
>> > 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.  
>> 
>> (looking back at patches I've neglected in patchwork as I have a notmuch
>> query for that now)
>> 
>> I'm interested in another alternative as we do have stupid unittests for
>> part of this code that is nice to have work.
>> 
>> I guess we could look at what idle states are enabled, and for the unit
>> tests, just enable none of them?
>> 
>
> Yeah that could work for unit tests. One day if we get mambo fixed we
> could turn it back on too. I'll have to get back to looking at that,
> but I've had enough system reset problems for the moment :) The mambo
> devs are busy with other things too I think.

Yeah, there's probably a few things above this on the TODO list for
them :)

I'll see if I can be bothered whipping up a patch shortly.

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)