1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2f98deee9SArd Biesheuvel /* 3f98deee9SArd Biesheuvel * Copyright (C) 2012 ARM Ltd. 4f98deee9SArd Biesheuvel */ 5f98deee9SArd Biesheuvel 6f98deee9SArd Biesheuvel #ifndef __ASM_BRK_IMM_H 7f98deee9SArd Biesheuvel #define __ASM_BRK_IMM_H 8f98deee9SArd Biesheuvel 9f98deee9SArd Biesheuvel /* 10f98deee9SArd Biesheuvel * #imm16 values used for BRK instruction generation 11453b7740SWill Deacon * 0x004: for installing kprobes 12453b7740SWill Deacon * 0x005: for installing uprobes 137ee31a3aSJean-Philippe Brucker * 0x006: for kprobe software single-step 14f98deee9SArd Biesheuvel * Allowed values for kgdb are 0x400 - 0x7ff 15f98deee9SArd Biesheuvel * 0x100: for triggering a fault on purpose (reserved) 16f98deee9SArd Biesheuvel * 0x400: for dynamic BRK instruction 17f98deee9SArd Biesheuvel * 0x401: for compile time BRK instruction 18f98deee9SArd Biesheuvel * 0x800: kernel-mode BUG() and WARN() traps 1941eea9cdSAndrey Konovalov * 0x9xx: tag-based KASAN trap (allowed values 0x900 - 0x9ff) 20*b26e484bSSami Tolvanen * 0x8xxx: Control-Flow Integrity traps 21f98deee9SArd Biesheuvel */ 22453b7740SWill Deacon #define KPROBES_BRK_IMM 0x004 23453b7740SWill Deacon #define UPROBES_BRK_IMM 0x005 247ee31a3aSJean-Philippe Brucker #define KPROBES_BRK_SS_IMM 0x006 25f98deee9SArd Biesheuvel #define FAULT_BRK_IMM 0x100 26f98deee9SArd Biesheuvel #define KGDB_DYN_DBG_BRK_IMM 0x400 27f98deee9SArd Biesheuvel #define KGDB_COMPILED_DBG_BRK_IMM 0x401 28f98deee9SArd Biesheuvel #define BUG_BRK_IMM 0x800 2941eea9cdSAndrey Konovalov #define KASAN_BRK_IMM 0x900 3026a04d84SWill Deacon #define KASAN_BRK_MASK 0x0ff 31f98deee9SArd Biesheuvel 32*b26e484bSSami Tolvanen #define CFI_BRK_IMM_TARGET GENMASK(4, 0) 33*b26e484bSSami Tolvanen #define CFI_BRK_IMM_TYPE GENMASK(9, 5) 34*b26e484bSSami Tolvanen #define CFI_BRK_IMM_BASE 0x8000 35*b26e484bSSami Tolvanen #define CFI_BRK_IMM_MASK (CFI_BRK_IMM_TARGET | CFI_BRK_IMM_TYPE) 36*b26e484bSSami Tolvanen 37f98deee9SArd Biesheuvel #endif 38