mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "Andreas Kleen" <ak@suse.de>
Cc: <linux-kernel@vger.kernel.org>, <discuss@x86-64.org>
Subject: [PATCH] fix x86-64 condition to call nmi_watchdog_tick
Date: Thu, 08 Sep 2005 18:11:28 +0200	[thread overview]
Message-ID: <43207ED00200007800024566@emea1-mh.id2.novell.com> (raw)

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

             reply	other threads:[~2005-09-08 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-08 16:11 Jan Beulich [this message]
2005-09-09  8:43 ` [discuss] " Andi Kleen
2005-09-09  8:53   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43207ED00200007800024566@emea1-mh.id2.novell.com \
    --to=jbeulich@novell.com \
    --cc=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®