Skip to contentSkip to conversation

kernel/watchdog: use nmi registers snapshot in hardlockup handler

PATCH Applied Konstantin Khlebnikov 3 participants 3 messages Jul 5, 2016 – Jul 8, 2016

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/watchdog: use nmi registers snapshot in hardlockup handler

NMI handler doesn't call set_irq_regs(), so get_irq_regs() returns NULL or stale snapshot from beginning of IRQ interrupted by NMI. Registers from argument are always here and points to interrupted instruction and state.

---
 kernel/watchdog.c |    1 -
 1 file changed, 1 deletion(-)
kernel/watchdog.c +0 -1
index 9acb29f280ec..6d1020c03d41 100644
@@ -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)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Konstantin Khlebnikov

NMI handler doesn't call set_irq_regs(), so get_irq_regs() returns NULL or stale snapshot from beginning of IRQ interrupted by NMI. Registers from argument are always here and points to interrupted instruction and state.

Good catch, thanks for fixing my thinko.

Signature · 2 lines
Jiri Kosina
SUSE Labs
#2 lore raw
In reply to Konstantin Khlebnikov
Quoted 3 lines · On Tue, 05 Jul 2016 14:20:47 +0300 Konstantin Khlebnikov…

NMI handler doesn't call set_irq_regs(), so get_irq_regs() returns NULL or stale snapshot from beginning of IRQ interrupted by NMI. Registers from argument are always here and points to interrupted instruction and state.

Changelog is quite poor. Please send along a new one which describes in full detail how this patch alters kernel behaviour.

Such a description will help others decide whether their kernel might need this patch and permits others to decide which kernel versions need the fix.