1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <linux/kernel_stat.h>
25#include <linux/irq.h>
26#include <linux/memory.h>
27#include <linux/smp.h>
28#include <linux/init.h>
29#include <linux/irqchip.h>
30#include <linux/kprobes.h>
31#include <linux/seq_file.h>
32#include <linux/vmalloc.h>
33#include <asm/daifflags.h>
34#include <asm/vmap_stack.h>
35
36unsigned long irq_err_count;
37
38
39DEFINE_PER_CPU(struct nmi_ctx, nmi_contexts);
40
41DEFINE_PER_CPU(unsigned long *, irq_stack_ptr);
42
43int arch_show_interrupts(struct seq_file *p, int prec)
44{
45 show_ipi_list(p, prec);
46 seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
47 return 0;
48}
49
50#ifdef CONFIG_VMAP_STACK
51static void init_irq_stacks(void)
52{
53 int cpu;
54 unsigned long *p;
55
56 for_each_possible_cpu(cpu) {
57 p = arch_alloc_vmap_stack(IRQ_STACK_SIZE, cpu_to_node(cpu));
58 per_cpu(irq_stack_ptr, cpu) = p;
59 }
60}
61#else
62
63DEFINE_PER_CPU_ALIGNED(unsigned long [IRQ_STACK_SIZE/sizeof(long)], irq_stack);
64
65static void init_irq_stacks(void)
66{
67 int cpu;
68
69 for_each_possible_cpu(cpu)
70 per_cpu(irq_stack_ptr, cpu) = per_cpu(irq_stack, cpu);
71}
72#endif
73
74void __init init_IRQ(void)
75{
76 init_irq_stacks();
77 irqchip_init();
78 if (!handle_arch_irq)
79 panic("No interrupt controller found.");
80
81 if (system_uses_irq_prio_masking()) {
82
83
84
85
86 WARN_ON(read_sysreg(daif) & PSR_A_BIT);
87 local_daif_restore(DAIF_PROCCTX_NOIRQ);
88 }
89}
90
91
92
93
94asmlinkage void notrace asm_nmi_enter(void)
95{
96 nmi_enter();
97}
98NOKPROBE_SYMBOL(asm_nmi_enter);
99
100asmlinkage void notrace asm_nmi_exit(void)
101{
102 nmi_exit();
103}
104NOKPROBE_SYMBOL(asm_nmi_exit);
105