105a2fdf3SJoerg Roedel /* SPDX-License-Identifier: GPL-2.0 */ 205a2fdf3SJoerg Roedel #ifndef _ASM_X86_TRAP_PF_H 305a2fdf3SJoerg Roedel #define _ASM_X86_TRAP_PF_H 405a2fdf3SJoerg Roedel 5*54055344SBrijesh Singh #include <linux/bits.h> 6*54055344SBrijesh Singh 705a2fdf3SJoerg Roedel /* 805a2fdf3SJoerg Roedel * Page fault error code bits: 905a2fdf3SJoerg Roedel * 1005a2fdf3SJoerg Roedel * bit 0 == 0: no page found 1: protection fault 1105a2fdf3SJoerg Roedel * bit 1 == 0: read access 1: write access 1205a2fdf3SJoerg Roedel * bit 2 == 0: kernel-mode access 1: user-mode access 1305a2fdf3SJoerg Roedel * bit 3 == 1: use of reserved bit detected 1405a2fdf3SJoerg Roedel * bit 4 == 1: fault was an instruction fetch 1505a2fdf3SJoerg Roedel * bit 5 == 1: protection keys block access 16fd5439e0SRick Edgecombe * bit 6 == 1: shadow stack access fault 1774faeee0SSean Christopherson * bit 15 == 1: SGX MMU page-fault 18*54055344SBrijesh Singh * bit 31 == 1: fault was due to RMP violation 1905a2fdf3SJoerg Roedel */ 2005a2fdf3SJoerg Roedel enum x86_pf_error_code { 21*54055344SBrijesh Singh X86_PF_PROT = BIT(0), 22*54055344SBrijesh Singh X86_PF_WRITE = BIT(1), 23*54055344SBrijesh Singh X86_PF_USER = BIT(2), 24*54055344SBrijesh Singh X86_PF_RSVD = BIT(3), 25*54055344SBrijesh Singh X86_PF_INSTR = BIT(4), 26*54055344SBrijesh Singh X86_PF_PK = BIT(5), 27*54055344SBrijesh Singh X86_PF_SHSTK = BIT(6), 28*54055344SBrijesh Singh X86_PF_SGX = BIT(15), 29*54055344SBrijesh Singh X86_PF_RMP = BIT(31), 3005a2fdf3SJoerg Roedel }; 3105a2fdf3SJoerg Roedel 3205a2fdf3SJoerg Roedel #endif /* _ASM_X86_TRAP_PF_H */ 33