mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix x86-64 condition to call nmi_watchdog_tick
@ 2005-09-08 16:11 Jan Beulich
  2005-09-09  8:43 ` [discuss] " Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2005-09-08 16:11 UTC (permalink / raw)
  To: Andreas Kleen; +Cc: linux-kernel, discuss

[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Don't call nmi_watchdog_tick() when this isn't enabled.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru 2.6.13/arch/x86_64/kernel/io_apic.c
2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/io_apic.c
--- 2.6.13/arch/x86_64/kernel/io_apic.c	2005-08-29
01:41:01.000000000 +0200
+++
2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/io_apic.c	2005-09-01
11:32:11.000000000 +0200
@@ -1529,6 +1529,7 @@ static void setup_nmi (void)
 	 */ 
 	printk(KERN_INFO "activating NMI Watchdog ...");
 
+	nmi_active = 1;
 	enable_NMI_through_LVT0(NULL);
 
 	printk(" done.\n");
diff -Npru 2.6.13/arch/x86_64/kernel/traps.c
2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/traps.c
--- 2.6.13/arch/x86_64/kernel/traps.c	2005-08-29 01:41:01.000000000
+0200
+++
2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/traps.c	2005-09-07
13:30:20.000000000 +0200
@@ -603,7 +603,7 @@ asmlinkage void default_do_nmi(struct pt
 		 * Ok, so this is none of the documented NMI sources,
 		 * so it must be the NMI watchdog.
 		 */
-		if (nmi_watchdog > 0) {
+		if (nmi_watchdog > 0 && nmi_active > 0) {
 			nmi_watchdog_tick(regs,reason);
 			return;
 		}
diff -Npru 2.6.13/include/asm-x86_64/apic.h
2.6.13-x86_64-watchdog-active/include/asm-x86_64/apic.h
--- 2.6.13/include/asm-x86_64/apic.h	2005-08-29 01:41:01.000000000
+0200
+++
2.6.13-x86_64-watchdog-active/include/asm-x86_64/apic.h	2005-09-01
11:32:12.000000000 +0200
@@ -103,6 +103,7 @@ extern void nmi_watchdog_default(void);
 extern int setup_nmi_watchdog(char *);
 
 extern unsigned int nmi_watchdog;
+extern int nmi_active;
 #define NMI_DEFAULT	-1
 #define NMI_NONE	0
 #define NMI_IO_APIC	1


[-- Attachment #2: linux-2.6.13-x86_64-watchdog-active.patch --]
[-- Type: application/octet-stream, Size: 1720 bytes --]

(Note: Patch also attached because the inline version is certain to get
line wrapped.)

Don't call nmi_watchdog_tick() when this isn't enabled.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru 2.6.13/arch/x86_64/kernel/io_apic.c 2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/io_apic.c
--- 2.6.13/arch/x86_64/kernel/io_apic.c	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/io_apic.c	2005-09-01 11:32:11.000000000 +0200
@@ -1529,6 +1529,7 @@ static void setup_nmi (void)
 	 */ 
 	printk(KERN_INFO "activating NMI Watchdog ...");
 
+	nmi_active = 1;
 	enable_NMI_through_LVT0(NULL);
 
 	printk(" done.\n");
diff -Npru 2.6.13/arch/x86_64/kernel/traps.c 2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/traps.c
--- 2.6.13/arch/x86_64/kernel/traps.c	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-watchdog-active/arch/x86_64/kernel/traps.c	2005-09-07 13:30:20.000000000 +0200
@@ -603,7 +603,7 @@ asmlinkage void default_do_nmi(struct pt
 		 * Ok, so this is none of the documented NMI sources,
 		 * so it must be the NMI watchdog.
 		 */
-		if (nmi_watchdog > 0) {
+		if (nmi_watchdog > 0 && nmi_active > 0) {
 			nmi_watchdog_tick(regs,reason);
 			return;
 		}
diff -Npru 2.6.13/include/asm-x86_64/apic.h 2.6.13-x86_64-watchdog-active/include/asm-x86_64/apic.h
--- 2.6.13/include/asm-x86_64/apic.h	2005-08-29 01:41:01.000000000 +0200
+++ 2.6.13-x86_64-watchdog-active/include/asm-x86_64/apic.h	2005-09-01 11:32:12.000000000 +0200
@@ -103,6 +103,7 @@ extern void nmi_watchdog_default(void);
 extern int setup_nmi_watchdog(char *);
 
 extern unsigned int nmi_watchdog;
+extern int nmi_active;
 #define NMI_DEFAULT	-1
 #define NMI_NONE	0
 #define NMI_IO_APIC	1

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

end of thread, other threads:[~2005-09-09  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-08 16:11 [PATCH] fix x86-64 condition to call nmi_watchdog_tick Jan Beulich
2005-09-09  8:43 ` [discuss] " Andi Kleen
2005-09-09  8:53   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®