linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel/watchdog: use nmi registers snapshot in hardlockup handler
@ 2016-07-05 11:20 Konstantin Khlebnikov
  2016-07-07  8:30 ` Jiri Kosina
  2016-07-08 21:02 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Konstantin Khlebnikov @ 2016-07-05 11:20 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel; +Cc: Jiri Kosina, Ulrich Obergfell, Aaron Tomlin

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.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/watchdog: use nmi registers snapshot in hardlockup handler
  2016-07-05 11:20 [PATCH] kernel/watchdog: use nmi registers snapshot in hardlockup handler Konstantin Khlebnikov
@ 2016-07-07  8:30 ` Jiri Kosina
  2016-07-08 21:02 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2016-07-07  8:30 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: Andrew Morton, linux-kernel, Ulrich Obergfell, Aaron Tomlin

On Tue, 5 Jul 2016, Konstantin Khlebnikov wrote:

> 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.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Cc: Jiri Kosina <jkosina@suse.cz>

Good catch, thanks for fixing my thinko.

	Reviewed-by: Jiri Kosina <jkosina@suse.cz>

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kernel/watchdog: use nmi registers snapshot in hardlockup handler
  2016-07-05 11:20 [PATCH] kernel/watchdog: use nmi registers snapshot in hardlockup handler Konstantin Khlebnikov
  2016-07-07  8:30 ` Jiri Kosina
@ 2016-07-08 21:02 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2016-07-08 21:02 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: linux-kernel, Jiri Kosina, Ulrich Obergfell, Aaron Tomlin

On Tue, 05 Jul 2016 14:20:47 +0300 Konstantin Khlebnikov <khlebnikov@yandex-team.ru> wrote:

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-08 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-05 11:20 [PATCH] kernel/watchdog: use nmi registers snapshot in hardlockup handler Konstantin Khlebnikov
2016-07-07  8:30 ` Jiri Kosina
2016-07-08 21:02 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).