aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/nmi.c16
-rw-r--r--include/asm-x86/nmi.h4
2 files changed, 12 insertions, 8 deletions
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 69a839fc1eb0..3671a9f3564b 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -84,20 +84,15 @@ static inline unsigned int get_timer_irqs(int cpu)
84#endif 84#endif
85} 85}
86 86
87#ifdef CONFIG_X86_64
87/* Run after command line and cpu_init init, but before all other checks */ 88/* Run after command line and cpu_init init, but before all other checks */
88void nmi_watchdog_default(void) 89void nmi_watchdog_default(void)
89{ 90{
90 if (nmi_watchdog != NMI_DEFAULT) 91 if (nmi_watchdog != NMI_DEFAULT)
91 return; 92 return;
92#ifdef CONFIG_X86_64
93 nmi_watchdog = NMI_NONE; 93 nmi_watchdog = NMI_NONE;
94#else
95 if (lapic_watchdog_ok())
96 nmi_watchdog = NMI_LOCAL_APIC;
97 else
98 nmi_watchdog = NMI_IO_APIC;
99#endif
100} 94}
95#endif
101 96
102#ifdef CONFIG_SMP 97#ifdef CONFIG_SMP
103/* 98/*
@@ -488,8 +483,15 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
488 return -EIO; 483 return -EIO;
489 } 484 }
490 485
486#ifdef CONFIG_X86_64
491 /* if nmi_watchdog is not set yet, then set it */ 487 /* if nmi_watchdog is not set yet, then set it */
492 nmi_watchdog_default(); 488 nmi_watchdog_default();
489#else
490 if (lapic_watchdog_ok())
491 nmi_watchdog = NMI_LOCAL_APIC;
492 else
493 nmi_watchdog = NMI_IO_APIC;
494#endif
493 495
494 if (nmi_watchdog == NMI_LOCAL_APIC) { 496 if (nmi_watchdog == NMI_LOCAL_APIC) {
495 if (nmi_watchdog_enabled) 497 if (nmi_watchdog_enabled)
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h
index 1e8f34d7ab68..6f4d44fc051f 100644
--- a/include/asm-x86/nmi.h
+++ b/include/asm-x86/nmi.h
@@ -38,9 +38,11 @@ static inline void unset_nmi_pm_callback(struct pm_dev *dev)
38 38
39#ifdef CONFIG_X86_64 39#ifdef CONFIG_X86_64
40extern void default_do_nmi(struct pt_regs *); 40extern void default_do_nmi(struct pt_regs *);
41extern void nmi_watchdog_default(void);
42#else
43#define nmi_watchdog_default(void) do {} while (0)
41#endif 44#endif
42 45
43extern void nmi_watchdog_default(void);
44extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); 46extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
45extern int check_nmi_watchdog(void); 47extern int check_nmi_watchdog(void);
46extern int nmi_watchdog_enabled; 48extern int nmi_watchdog_enabled;