drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / x86 / kernel / apic / hw_nmi.c
blob45af535c44a07de0c4198acd4aa66fbd0c045e93
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * HW NMI watchdog support
5 * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc.
7 * Arch specific calls to support NMI watchdog
9 * Bits copied from original nmi.c file
12 #include <linux/thread_info.h>
13 #include <asm/apic.h>
14 #include <asm/nmi.h>
16 #include <linux/cpumask.h>
17 #include <linux/kdebug.h>
18 #include <linux/notifier.h>
19 #include <linux/kprobes.h>
20 #include <linux/nmi.h>
21 #include <linux/init.h>
22 #include <linux/delay.h>
24 #include "local.h"
26 #ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF
27 u64 hw_nmi_get_sample_period(int watchdog_thresh)
29 return (u64)(cpu_khz) * 1000 * watchdog_thresh;
31 #endif
33 #ifdef arch_trigger_cpumask_backtrace
34 static void nmi_raise_cpu_backtrace(cpumask_t *mask)
36 __apic_send_IPI_mask(mask, NMI_VECTOR);
39 void arch_trigger_cpumask_backtrace(const cpumask_t *mask, int exclude_cpu)
41 nmi_trigger_cpumask_backtrace(mask, exclude_cpu,
42 nmi_raise_cpu_backtrace);
45 static int nmi_cpu_backtrace_handler(unsigned int cmd, struct pt_regs *regs)
47 if (nmi_cpu_backtrace(regs))
48 return NMI_HANDLED;
50 return NMI_DONE;
52 NOKPROBE_SYMBOL(nmi_cpu_backtrace_handler);
54 static int __init register_nmi_cpu_backtrace_handler(void)
56 register_nmi_handler(NMI_LOCAL, nmi_cpu_backtrace_handler,
57 0, "arch_bt");
58 return 0;
60 early_initcall(register_nmi_cpu_backtrace_handler);
61 #endif