mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 05:04:00 +08:00
751521149a
Collected NMI watchdog fixes. - Fix call of check_nmi_watchdog - Remove earlier move of check_nmi_watchdog to later. It does not fix the race it was supposed to fix fully. - Remove unused P6 definitions - Add support for performance counter based watchdog on P4 systems. This allows to run it only once per second, which saves some CPU time. Previously it would run at 1000Hz, which was too much. Code ported from i386 Make this the default on Intel systems. - Use check_nmi_watchdog with local APIC based nmi - Fix race in touch_nmi_watchdog - Fix bug that caused incorrect performance counters to be programmed in a few cases on K8. - Remove useless check for local APIC - Use local_t and per_cpu variables for per CPU data. - Keep other CPUs busy during check_nmi_watchdog to make sure they really tick when in lapic mode. - Only check CPUs that are actually online. - Various other fixes. - Fix fallback path when MSRs are unimplemented Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
60 lines
1.1 KiB
C
60 lines
1.1 KiB
C
/*
|
|
* linux/include/asm-i386/nmi.h
|
|
*/
|
|
#ifndef ASM_NMI_H
|
|
#define ASM_NMI_H
|
|
|
|
#include <linux/pm.h>
|
|
|
|
struct pt_regs;
|
|
|
|
typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu);
|
|
|
|
/**
|
|
* set_nmi_callback
|
|
*
|
|
* Set a handler for an NMI. Only one handler may be
|
|
* set. Return 1 if the NMI was handled.
|
|
*/
|
|
void set_nmi_callback(nmi_callback_t callback);
|
|
|
|
/**
|
|
* unset_nmi_callback
|
|
*
|
|
* Remove the handler previously set.
|
|
*/
|
|
void unset_nmi_callback(void);
|
|
|
|
#ifdef CONFIG_PM
|
|
|
|
/** Replace the PM callback routine for NMI. */
|
|
struct pm_dev * set_nmi_pm_callback(pm_callback callback);
|
|
|
|
/** Unset the PM callback routine back to the default. */
|
|
void unset_nmi_pm_callback(struct pm_dev * dev);
|
|
|
|
#else
|
|
|
|
static inline struct pm_dev * set_nmi_pm_callback(pm_callback callback)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void unset_nmi_pm_callback(struct pm_dev * dev)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_PM */
|
|
|
|
extern void default_do_nmi(struct pt_regs *);
|
|
extern void die_nmi(char *str, struct pt_regs *regs);
|
|
|
|
#define get_nmi_reason() inb(0x61)
|
|
|
|
extern int panic_on_timeout;
|
|
extern int unknown_nmi_panic;
|
|
|
|
extern int check_nmi_watchdog(void);
|
|
|
|
#endif /* ASM_NMI_H */
|