xref: /linux/arch/x86/include/asm/trapnr.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1877f183fSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0 */
2877f183fSThomas Gleixner #ifndef _ASM_X86_TRAPNR_H
3877f183fSThomas Gleixner #define _ASM_X86_TRAPNR_H
4877f183fSThomas Gleixner 
5*8df71934SXin Li /*
6*8df71934SXin Li  * Event type codes used by FRED, Intel VT-x and AMD SVM
7*8df71934SXin Li  */
8*8df71934SXin Li #define EVENT_TYPE_EXTINT	0	// External interrupt
9*8df71934SXin Li #define EVENT_TYPE_RESERVED	1
10*8df71934SXin Li #define EVENT_TYPE_NMI		2	// NMI
11*8df71934SXin Li #define EVENT_TYPE_HWEXC	3	// Hardware originated traps, exceptions
12*8df71934SXin Li #define EVENT_TYPE_SWINT	4	// INT n
13*8df71934SXin Li #define EVENT_TYPE_PRIV_SWEXC	5	// INT1
14*8df71934SXin Li #define EVENT_TYPE_SWEXC	6	// INTO, INT3
15*8df71934SXin Li #define EVENT_TYPE_OTHER	7	// FRED SYSCALL/SYSENTER, VT-x MTF
16*8df71934SXin Li 
17877f183fSThomas Gleixner /* Interrupts/Exceptions */
18877f183fSThomas Gleixner 
19877f183fSThomas Gleixner #define X86_TRAP_DE		 0	/* Divide-by-zero */
20877f183fSThomas Gleixner #define X86_TRAP_DB		 1	/* Debug */
21877f183fSThomas Gleixner #define X86_TRAP_NMI		 2	/* Non-maskable Interrupt */
22877f183fSThomas Gleixner #define X86_TRAP_BP		 3	/* Breakpoint */
23877f183fSThomas Gleixner #define X86_TRAP_OF		 4	/* Overflow */
24877f183fSThomas Gleixner #define X86_TRAP_BR		 5	/* Bound Range Exceeded */
25877f183fSThomas Gleixner #define X86_TRAP_UD		 6	/* Invalid Opcode */
26877f183fSThomas Gleixner #define X86_TRAP_NM		 7	/* Device Not Available */
27877f183fSThomas Gleixner #define X86_TRAP_DF		 8	/* Double Fault */
28877f183fSThomas Gleixner #define X86_TRAP_OLD_MF		 9	/* Coprocessor Segment Overrun */
29877f183fSThomas Gleixner #define X86_TRAP_TS		10	/* Invalid TSS */
30877f183fSThomas Gleixner #define X86_TRAP_NP		11	/* Segment Not Present */
31877f183fSThomas Gleixner #define X86_TRAP_SS		12	/* Stack Segment Fault */
32877f183fSThomas Gleixner #define X86_TRAP_GP		13	/* General Protection Fault */
33877f183fSThomas Gleixner #define X86_TRAP_PF		14	/* Page Fault */
34877f183fSThomas Gleixner #define X86_TRAP_SPURIOUS	15	/* Spurious Interrupt */
35877f183fSThomas Gleixner #define X86_TRAP_MF		16	/* x87 Floating-Point Exception */
36877f183fSThomas Gleixner #define X86_TRAP_AC		17	/* Alignment Check */
37877f183fSThomas Gleixner #define X86_TRAP_MC		18	/* Machine Check */
38877f183fSThomas Gleixner #define X86_TRAP_XF		19	/* SIMD Floating-Point Exception */
39877f183fSThomas Gleixner #define X86_TRAP_VE		20	/* Virtualization Exception */
40877f183fSThomas Gleixner #define X86_TRAP_CP		21	/* Control Protection Exception */
4129dcc60fSJoerg Roedel #define X86_TRAP_VC		29	/* VMM Communication Exception */
42877f183fSThomas Gleixner #define X86_TRAP_IRET		32	/* IRET Exception */
43877f183fSThomas Gleixner 
44877f183fSThomas Gleixner #endif
45