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*25b84002SKees Cook * 0x55xx: Undefined Behavior Sanitizer traps ('U' << 8) 21b26e484bSSami Tolvanen * 0x8xxx: Control-Flow Integrity traps 22f98deee9SArd Biesheuvel */ 23453b7740SWill Deacon #define KPROBES_BRK_IMM 0x004 24453b7740SWill Deacon #define UPROBES_BRK_IMM 0x005 257ee31a3aSJean-Philippe Brucker #define KPROBES_BRK_SS_IMM 0x006 26f98deee9SArd Biesheuvel #define FAULT_BRK_IMM 0x100 27f98deee9SArd Biesheuvel #define KGDB_DYN_DBG_BRK_IMM 0x400 28f98deee9SArd Biesheuvel #define KGDB_COMPILED_DBG_BRK_IMM 0x401 29f98deee9SArd Biesheuvel #define BUG_BRK_IMM 0x800 3041eea9cdSAndrey Konovalov #define KASAN_BRK_IMM 0x900 3126a04d84SWill Deacon #define KASAN_BRK_MASK 0x0ff 32*25b84002SKees Cook #define UBSAN_BRK_IMM 0x5500 33*25b84002SKees Cook #define UBSAN_BRK_MASK 0x00ff 34f98deee9SArd Biesheuvel 35b26e484bSSami Tolvanen #define CFI_BRK_IMM_TARGET GENMASK(4, 0) 36b26e484bSSami Tolvanen #define CFI_BRK_IMM_TYPE GENMASK(9, 5) 37b26e484bSSami Tolvanen #define CFI_BRK_IMM_BASE 0x8000 38b26e484bSSami Tolvanen #define CFI_BRK_IMM_MASK (CFI_BRK_IMM_TARGET | CFI_BRK_IMM_TYPE) 39b26e484bSSami Tolvanen 40f98deee9SArd Biesheuvel #endif 41