summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohit Vaswani <rvaswani@codeaurora.org>2014-06-26 21:29:37 -0700
committerRohit Vaswani <rvaswani@codeaurora.org>2016-03-01 12:22:10 -0800
commitabf6131264e60ad0ae85191fd1e70928f40fd2c7 (patch)
treefece2020723869485a43250daccb6617f05d8e12
parent47ae5b18729dcd554e28bd414d005c2c515e293b (diff)
ARM64: smp: Save CPU registers before IPI_CPU_STOP processing
When a kernel panic occurs on one CPU, other CPUs are instructed to stop execution via the IPI_CPU_STOP message. These other CPUs dump their stack, which may not be good enough to reconstruct their context to perform post-mortem analysis. Dump each CPU's context (before it started procesing the IPI) into a globally accessible structure and print them on the dmesg/console to allow for easier post-mortem debugging. Change-Id: Ifd7589af4327992540196c87f8b640045d7eaf19 Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org> [abhimany: resolve trivial merge conflic] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
-rw-r--r--arch/arm64/kernel/smp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index b1adc51b2c2e..3349cb6e5cbe 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -680,15 +680,19 @@ void arch_irq_work_raise(void)
static DEFINE_RAW_SPINLOCK(stop_lock);
+static struct pt_regs __percpu regs_before_stop;
+
/*
* ipi_cpu_stop - handle IPI from smp_send_stop()
*/
-static void ipi_cpu_stop(unsigned int cpu)
+static void ipi_cpu_stop(unsigned int cpu, struct pt_regs *regs)
{
if (system_state == SYSTEM_BOOTING ||
system_state == SYSTEM_RUNNING) {
+ per_cpu(regs_before_stop, cpu) = *regs;
raw_spin_lock(&stop_lock);
pr_crit("CPU%u: stopping\n", cpu);
+ show_regs(regs);
dump_stack();
raw_spin_unlock(&stop_lock);
}
@@ -727,7 +731,7 @@ void handle_IPI(int ipinr, struct pt_regs *regs)
case IPI_CPU_STOP:
irq_enter();
- ipi_cpu_stop(cpu);
+ ipi_cpu_stop(cpu, regs);
irq_exit();
break;