aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/traps.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@mellanox.com>2016-10-07 20:02:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:30 -0400
commit511f8389454e55ece5115dc3bc84a0947788ff4f (patch)
treedfc902d595e5f55141f84a29a7b11c750b09c615 /arch/tile/kernel/traps.c
parent677664895278267a80bda0e3b26821d60cdbebf5 (diff)
arch/tile: adopt the new nmi_backtrace framework
Previously tile was rolling its own method of capturing backtrace data in the NMI handlers, but it was relying on running printk() from the NMI handler, which is not always safe. So adopt the nmi_backtrace model (with the new cpumask extension) instead. So we can call the nmi_backtrace code directly from the nmi handler, move the nmi_enter()/exit() into the top-level tile NMI handler. The semantics of the routine change slightly since it is now synchronous with the remote cores completing the backtraces. Previously it was asynchronous, but with protection to avoid starting a new remote backtrace if the old one was still in progress. Link: http://lkml.kernel.org/r/1472487169-14923-4-git-send-email-cmetcalf@mellanox.com Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com> Cc: Daniel Thompson <daniel.thompson@linaro.org> [arm] Cc: Petr Mladek <pmladek@suse.com> Cc: Aaron Tomlin <atomlin@redhat.com> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Russell King <linux@arm.linux.org.uk> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/tile/kernel/traps.c')
-rw-r--r--arch/tile/kernel/traps.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/tile/kernel/traps.c b/arch/tile/kernel/traps.c
index 4d9651c5b1ad..39f427bb0de2 100644
--- a/arch/tile/kernel/traps.c
+++ b/arch/tile/kernel/traps.c
@@ -20,6 +20,8 @@
20#include <linux/reboot.h> 20#include <linux/reboot.h>
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <linux/ptrace.h> 22#include <linux/ptrace.h>
23#include <linux/hardirq.h>
24#include <linux/nmi.h>
23#include <asm/stack.h> 25#include <asm/stack.h>
24#include <asm/traps.h> 26#include <asm/traps.h>
25#include <asm/setup.h> 27#include <asm/setup.h>
@@ -392,14 +394,17 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
392 394
393void do_nmi(struct pt_regs *regs, int fault_num, unsigned long reason) 395void do_nmi(struct pt_regs *regs, int fault_num, unsigned long reason)
394{ 396{
397 nmi_enter();
395 switch (reason) { 398 switch (reason) {
399#ifdef arch_trigger_cpumask_backtrace
396 case TILE_NMI_DUMP_STACK: 400 case TILE_NMI_DUMP_STACK:
397 do_nmi_dump_stack(regs); 401 nmi_cpu_backtrace(regs);
398 break; 402 break;
403#endif
399 default: 404 default:
400 panic("Unexpected do_nmi type %ld", reason); 405 panic("Unexpected do_nmi type %ld", reason);
401 return;
402 } 406 }
407 nmi_exit();
403} 408}
404 409
405/* Deprecated function currently only used here. */ 410/* Deprecated function currently only used here. */