lkml.org 
[lkml]   [2016]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v2 comment update] kernel/watchdog: use nmi registers snapshot in hardlockup handler
From
Date
NMI handler doesn't call set_irq_regs(), it's set only by normal IRQ.
Thus get_irq_regs() returns NULL or stale registers snapshot with IP/SP
pointing to the code interrupted by IRQ which was interrupted by NMI.
NULL isn't a problem: in this case watchdog calls dump_stack() and prints
full stack trace including NMI. But if we're stuck in IRQ handler then
NMI watchlog will print stack trace without IRQ part at all.

This patch uses registers snapshot passed into NMI handler as arguments:
these registers points exactly to the instruction interrupted by NMI.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 55537871ef66 ("kernel/watchdog.c: perform all-CPU backtrace in case of hard lockup")
Cc: Stable <stable@vger.kernel.org> # 4.4+
Cc: Jiri Kosina <jkosina@suse.cz>
---
kernel/watchdog.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 9acb29f280ec..6d1020c03d41 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -344,7 +344,6 @@ static void watchdog_overflow_callback(struct perf_event *event,
*/
if (is_hardlockup()) {
int this_cpu = smp_processor_id();
- struct pt_regs *regs = get_irq_regs();

/* only print hardlockups once */
if (__this_cpu_read(hard_watchdog_warn) == true)
\
 
 \ /
  Last update: 2016-07-16 16:41    [W:0.047 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site