All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "kernel/watchdog: use nmi registers snapshot in hardlockup handler" has been added to the 4.9-stable tree
@ 2017-01-04 14:00 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-01-04 14:00 UTC (permalink / raw)
  To: khlebnikov, akpm, atomlin, gregkh, jkosina, torvalds, uobergfe
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    kernel/watchdog: use nmi registers snapshot in hardlockup handler

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kernel-watchdog-use-nmi-registers-snapshot-in-hardlockup-handler.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 4d1f0fb096aedea7bb5489af93498a82e467c480 Mon Sep 17 00:00:00 2001
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Date: Wed, 14 Dec 2016 15:04:04 -0800
Subject: kernel/watchdog: use nmi registers snapshot in hardlockup handler

From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>

commit 4d1f0fb096aedea7bb5489af93498a82e467c480 upstream.

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 point exactly to the instruction interrupted by NMI.

Fixes: 55537871ef66 ("kernel/watchdog.c: perform all-CPU backtrace in case of hard lockup")
Link: http://lkml.kernel.org/r/146771764784.86724.6006627197118544150.stgit@buzz
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: Aaron Tomlin <atomlin@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/watchdog.c |    1 -
 1 file changed, 1 deletion(-)

--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -344,7 +344,6 @@ static void watchdog_overflow_callback(s
 	 */
 	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)


Patches currently in stable-queue which might be from khlebnikov@yandex-team.ru are

queue-4.9/kernel-watchdog-use-nmi-registers-snapshot-in-hardlockup-handler.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-04 14:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04 14:00 Patch "kernel/watchdog: use nmi registers snapshot in hardlockup handler" has been added to the 4.9-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.