Skip to contentSkip to conversation

sparc64: fatal trap should stop all cpus

PATCH Superseded Dave Kleikamp 1 participant 1 message Dec 29, 2014 SPARC + UltraSPARC (sparc/sparc64)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: fatal trap should stop all cpus

"echo c > /proc/sysrq-trigger" does not result in a system crash. There are two problems. One is that the trap handler ignores the global variable, panic_on_oops. The other is that smp_send_stop() is a no-op which leaves the other cpus running normally when one cpu panics.

---
 arch/sparc/kernel/smp_64.c   |   12 +++++++++---
 arch/sparc/kernel/traps_64.c |    2 ++
 2 files changed, 11 insertions(+), 3 deletions(-)
arch/sparc/kernel/smp_64.c +9 -3
index 32d4b3b..37d5789 100644
@@ -1406,11 +1406,17 @@ void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
 	scheduler_ipi();
 }
 
-/* This is a nop because we capture all other cpus
- * anyways when making the PROM active.
- */
+void stop_this_cpu(void *dummy)
+{
+	set_cpu_online(smp_processor_id(), false);
+
+	local_irq_disable();
+	while (1) ;
+}
+
 void smp_send_stop(void)
 {
+	smp_call_function(stop_this_cpu, NULL, 0);
 }
 
 /**
arch/sparc/kernel/traps_64.c +2 -0
index e7ecf15..720be08 100644
@@ -2408,6 +2408,8 @@ void die_if_kernel(char *str, struct pt_regs *regs)
 		}
 		user_instruction_dump ((unsigned int __user *) regs->tpc);
 	}
+	if (panic_on_oops)
+		panic("Fatal exception");
 	if (regs->tstate & TSTATE_PRIV)
 		do_exit(SIGKILL);
 	do_exit(SIGSEGV);
Signature · 1 line
1.7.1