xref: /openbmc/linux/arch/x86/include/asm/trap_pf.h (revision d9fd5a71)
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 15 ==				1: SGX MMU page-fault
15  */
16 enum x86_pf_error_code {
17 	X86_PF_PROT	=		1 << 0,
18 	X86_PF_WRITE	=		1 << 1,
19 	X86_PF_USER	=		1 << 2,
20 	X86_PF_RSVD	=		1 << 3,
21 	X86_PF_INSTR	=		1 << 4,
22 	X86_PF_PK	=		1 << 5,
23 	X86_PF_SGX	=		1 << 15,
24 };
25 
26 #endif /* _ASM_X86_TRAP_PF_H */
27