Skip to contentSkip to conversation

Patch "kernel/watchdog: use nmi registers snapshot in hardlockup handler" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Jan 4, 2017 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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.4-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.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 4d1f0fb096aedea7bb5489af93498a82e467c480 Mon Sep 17 00:00:00 2001

From: Konstantin Khlebnikov <[email protected]>
Date: Wed, 14 Dec 2016 15:04:04 -0800
Subject: kernel/watchdog: use nmi registers snapshot in hardlockup handler

From: Konstantin Khlebnikov <[email protected]>

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")
Cc Jiri Kosina <[email protected]>
Cc Ulrich Obergfell <[email protected]>
Cc Aaron Tomlin <[email protected]>
---
 kernel/watchdog.c |    1 -
 1 file changed, 1 deletion(-)
kernel/watchdog.c +0 -1
@@ -328,7 +328,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 [email protected] are

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