diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-06-03 17:00:47 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-06-05 09:13:59 -0400 |
commit | 3ed3f06295e69700fa808396f7b350bff2b69de0 (patch) | |
tree | 055601a094e512a1eabad4dd8352dae16658e575 | |
parent | 3d1ba1da2b4ff4ace7801e99fb9a3095b182d847 (diff) |
x86: nmi - consolidate nmi_watchdog_default for 32bit mode
64bit mode bootstrap code does set nmi_watchdog to NMI_NONE
by default and doing the same on 32bit mode is safe too.
Such an action saves us from several #ifdef.
Btw, my previous commit
commit 19ec673ced067316b9732bc6d1c4ff4052e5f795
Author: Cyrill Gorcunov <gorcunov@gmail.com>
Date: Wed May 28 23:00:47 2008 +0400
x86: nmi - fix incorrect NMI watchdog used by default
did not fix the problem completely, moreover it
introduced additional bug - nmi_watchdog would be
set to either NMI_LOCAL_APIC or NMI_IO_APIC
_regardless_ to boot option if being enabled thru
/proc/sys/kernel/nmi_watchdog. Sorry for that.
Fix it too.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: mingo@redhat.com
Cc: hpa@zytor.com
Cc: macro@linux-mips.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/nmi.c | 14 | ||||
-rw-r--r-- | include/asm-x86/nmi.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index cbd4fa3c475b..27ca8f69b466 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c | |||
@@ -487,14 +487,16 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file, | |||
487 | return -EIO; | 487 | return -EIO; |
488 | } | 488 | } |
489 | 489 | ||
490 | #ifdef CONFIG_X86_64 | ||
491 | /* if nmi_watchdog is not set yet, then set it */ | 490 | /* if nmi_watchdog is not set yet, then set it */ |
492 | nmi_watchdog_default(); | 491 | nmi_watchdog_default(); |
493 | #else | 492 | |
494 | if (lapic_watchdog_ok()) | 493 | #ifdef CONFIG_X86_32 |
495 | nmi_watchdog = NMI_LOCAL_APIC; | 494 | if (nmi_watchdog == NMI_NONE) { |
496 | else | 495 | if (lapic_watchdog_ok()) |
497 | nmi_watchdog = NMI_IO_APIC; | 496 | nmi_watchdog = NMI_LOCAL_APIC; |
497 | else | ||
498 | nmi_watchdog = NMI_IO_APIC; | ||
499 | } | ||
498 | #endif | 500 | #endif |
499 | 501 | ||
500 | if (nmi_watchdog == NMI_LOCAL_APIC) { | 502 | if (nmi_watchdog == NMI_LOCAL_APIC) { |
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h index 972a4f6f799a..470bb4aacb75 100644 --- a/include/asm-x86/nmi.h +++ b/include/asm-x86/nmi.h | |||
@@ -38,12 +38,10 @@ static inline void unset_nmi_pm_callback(struct pm_dev *dev) | |||
38 | 38 | ||
39 | #ifdef CONFIG_X86_64 | 39 | #ifdef CONFIG_X86_64 |
40 | extern void default_do_nmi(struct pt_regs *); | 40 | extern void default_do_nmi(struct pt_regs *); |
41 | extern void nmi_watchdog_default(void); | ||
42 | #else | ||
43 | #define nmi_watchdog_default() do { } while (0) | ||
44 | #endif | 41 | #endif |
45 | 42 | ||
46 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); | 43 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); |
44 | extern void nmi_watchdog_default(void); | ||
47 | extern int check_nmi_watchdog(void); | 45 | extern int check_nmi_watchdog(void); |
48 | extern int nmi_watchdog_enabled; | 46 | extern int nmi_watchdog_enabled; |
49 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); | 47 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |