xref: /linux/arch/x86/include/asm/trap_pf.h (revision a3f9e4bc1ec9d8f1e352eb7c1cbaea3168246be7)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_TRAP_PF_H
3 #define _ASM_X86_TRAP_PF_H
4 
5 /*
6  * Page fault error code bits:
7  *
8  *   bit 0 ==	 0: no page found	1: protection fault
9  *   bit 1 ==	 0: read access		1: write access
10  *   bit 2 ==	 0: kernel-mode access	1: user-mode access
11  *   bit 3 ==				1: use of reserved bit detected
12  *   bit 4 ==				1: fault was an instruction fetch
13  *   bit 5 ==				1: protection keys block access
14  *   bit 6 ==				1: shadow stack access fault
15  *   bit 15 ==				1: SGX MMU page-fault
16  */
17 enum x86_pf_error_code {
18 	X86_PF_PROT	=		1 << 0,
19 	X86_PF_WRITE	=		1 << 1,
20 	X86_PF_USER	=		1 << 2,
21 	X86_PF_RSVD	=		1 << 3,
22 	X86_PF_INSTR	=		1 << 4,
23 	X86_PF_PK	=		1 << 5,
24 	X86_PF_SHSTK	=		1 << 6,
25 	X86_PF_SGX	=		1 << 15,
26 };
27 
28 #endif /* _ASM_X86_TRAP_PF_H */
29