2 * HW NMI watchdog support
4 * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc.
6 * Arch specific calls to support NMI watchdog
8 * Bits copied from original nmi.c file
14 #include <linux/cpumask.h>
15 #include <linux/kdebug.h>
16 #include <linux/notifier.h>
17 #include <linux/kprobes.h>
18 #include <linux/nmi.h>
19 #include <linux/module.h>
20 #include <linux/delay.h>
21 #include <linux/seq_buf.h>
23 #ifdef CONFIG_HARDLOCKUP_DETECTOR
24 u64
hw_nmi_get_sample_period(int watchdog_thresh
)
26 return (u64
)(cpu_khz
) * 1000 * watchdog_thresh
;
30 #ifdef arch_trigger_all_cpu_backtrace
31 static void nmi_raise_cpu_backtrace(cpumask_t
*mask
)
33 apic
->send_IPI_mask(mask
, NMI_VECTOR
);
36 void arch_trigger_all_cpu_backtrace(bool include_self
)
38 nmi_trigger_all_cpu_backtrace(include_self
, nmi_raise_cpu_backtrace
);
42 arch_trigger_all_cpu_backtrace_handler(unsigned int cmd
, struct pt_regs
*regs
)
44 if (nmi_cpu_backtrace(regs
))
49 NOKPROBE_SYMBOL(arch_trigger_all_cpu_backtrace_handler
);
51 static int __init
register_trigger_all_cpu_backtrace(void)
53 register_nmi_handler(NMI_LOCAL
, arch_trigger_all_cpu_backtrace_handler
,
57 early_initcall(register_trigger_all_cpu_backtrace
);