mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-11 21:06:44 +07:00
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 19ec673ced
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>
This commit is contained in:
parent
3d1ba1da2b
commit
3ed3f06295
@ -487,14 +487,16 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file,
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
|
||||||
/* if nmi_watchdog is not set yet, then set it */
|
/* if nmi_watchdog is not set yet, then set it */
|
||||||
nmi_watchdog_default();
|
nmi_watchdog_default();
|
||||||
#else
|
|
||||||
if (lapic_watchdog_ok())
|
#ifdef CONFIG_X86_32
|
||||||
nmi_watchdog = NMI_LOCAL_APIC;
|
if (nmi_watchdog == NMI_NONE) {
|
||||||
else
|
if (lapic_watchdog_ok())
|
||||||
nmi_watchdog = NMI_IO_APIC;
|
nmi_watchdog = NMI_LOCAL_APIC;
|
||||||
|
else
|
||||||
|
nmi_watchdog = NMI_IO_APIC;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (nmi_watchdog == NMI_LOCAL_APIC) {
|
if (nmi_watchdog == NMI_LOCAL_APIC) {
|
||||||
|
@ -38,12 +38,10 @@ static inline void unset_nmi_pm_callback(struct pm_dev *dev)
|
|||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
extern void default_do_nmi(struct pt_regs *);
|
extern void default_do_nmi(struct pt_regs *);
|
||||||
extern void nmi_watchdog_default(void);
|
|
||||||
#else
|
|
||||||
#define nmi_watchdog_default() do { } while (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
|
extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
|
||||||
|
extern void nmi_watchdog_default(void);
|
||||||
extern int check_nmi_watchdog(void);
|
extern int check_nmi_watchdog(void);
|
||||||
extern int nmi_watchdog_enabled;
|
extern int nmi_watchdog_enabled;
|
||||||
extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
|
extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
|
||||||
|
Loading…
Reference in New Issue
Block a user