xref: /openbmc/linux/arch/x86/kernel/cpu/mce/threshold.c (revision a2818ee4)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Common corrected MCE threshold handler code:
4  */
5 #include <linux/interrupt.h>
6 #include <linux/kernel.h>
7 
8 #include <asm/irq_vectors.h>
9 #include <asm/traps.h>
10 #include <asm/apic.h>
11 #include <asm/mce.h>
12 #include <asm/trace/irq_vectors.h>
13 
14 #include "internal.h"
15 
16 static void default_threshold_interrupt(void)
17 {
18 	pr_err("Unexpected threshold interrupt at vector %x\n",
19 		THRESHOLD_APIC_VECTOR);
20 }
21 
22 void (*mce_threshold_vector)(void) = default_threshold_interrupt;
23 
24 asmlinkage __visible void __irq_entry smp_threshold_interrupt(struct pt_regs *regs)
25 {
26 	entering_irq();
27 	trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR);
28 	inc_irq_stat(irq_threshold_count);
29 	mce_threshold_vector();
30 	trace_threshold_apic_exit(THRESHOLD_APIC_VECTOR);
31 	exiting_ack_irq();
32 }
33