summaryrefslogtreecommitdiffstats
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 69a839f..3671a9f 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)
#endif
}
+#ifdef CONFIG_X86_64
/* Run after command line and cpu_init init, but before all other checks */
void nmi_watchdog_default(void)
{
if (nmi_watchdog != NMI_DEFAULT)
return;
-#ifdef CONFIG_X86_64
nmi_watchdog = NMI_NONE;
-#else
- if (lapic_watchdog_ok())
- nmi_watchdog = NMI_LOCAL_APIC;
- else
- nmi_watchdog = NMI_IO_APIC;
-#endif
}
+#endif
#ifdef CONFIG_SMP
/*
@@ -488,8 +483,15 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
return -EIO;
}
+#ifdef CONFIG_X86_64
/* if nmi_watchdog is not set yet, then set it */
nmi_watchdog_default();
+#else
+ if (lapic_watchdog_ok())
+ nmi_watchdog = NMI_LOCAL_APIC;
+ else
+ nmi_watchdog = NMI_IO_APIC;
+#endif
if (nmi_watchdog == NMI_LOCAL_APIC) {
if (nmi_watchdog_enabled)
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h
index 1e8f34d..6f4d44f 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)
#ifdef CONFIG_X86_64
extern void default_do_nmi(struct pt_regs *);
+extern void nmi_watchdog_default(void);
+#else
+#define nmi_watchdog_default(void) do {} while (0)
#endif
-extern void nmi_watchdog_default(void);
extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
extern int check_nmi_watchdog(void);
extern int nmi_watchdog_enabled;
OpenPOWER on IntegriCloud