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 14*25375123SMark Rutland * 0x007: for kretprobe return 15f98deee9SArd Biesheuvel * Allowed values for kgdb are 0x400 - 0x7ff 16f98deee9SArd Biesheuvel * 0x100: for triggering a fault on purpose (reserved) 17f98deee9SArd Biesheuvel * 0x400: for dynamic BRK instruction 18f98deee9SArd Biesheuvel * 0x401: for compile time BRK instruction 19f98deee9SArd Biesheuvel * 0x800: kernel-mode BUG() and WARN() traps 2041eea9cdSAndrey Konovalov * 0x9xx: tag-based KASAN trap (allowed values 0x900 - 0x9ff) 2125b84002SKees Cook * 0x55xx: Undefined Behavior Sanitizer traps ('U' << 8) 22b26e484bSSami Tolvanen * 0x8xxx: Control-Flow Integrity traps 23f98deee9SArd Biesheuvel */ 24453b7740SWill Deacon #define KPROBES_BRK_IMM 0x004 25453b7740SWill Deacon #define UPROBES_BRK_IMM 0x005 267ee31a3aSJean-Philippe Brucker #define KPROBES_BRK_SS_IMM 0x006 27*25375123SMark Rutland #define KRETPROBES_BRK_IMM 0x007 28f98deee9SArd Biesheuvel #define FAULT_BRK_IMM 0x100 29f98deee9SArd Biesheuvel #define KGDB_DYN_DBG_BRK_IMM 0x400 30f98deee9SArd Biesheuvel #define KGDB_COMPILED_DBG_BRK_IMM 0x401 31f98deee9SArd Biesheuvel #define BUG_BRK_IMM 0x800 3241eea9cdSAndrey Konovalov #define KASAN_BRK_IMM 0x900 3326a04d84SWill Deacon #define KASAN_BRK_MASK 0x0ff 3425b84002SKees Cook #define UBSAN_BRK_IMM 0x5500 3525b84002SKees Cook #define UBSAN_BRK_MASK 0x00ff 36f98deee9SArd Biesheuvel 37b26e484bSSami Tolvanen #define CFI_BRK_IMM_TARGET GENMASK(4, 0) 38b26e484bSSami Tolvanen #define CFI_BRK_IMM_TYPE GENMASK(9, 5) 39b26e484bSSami Tolvanen #define CFI_BRK_IMM_BASE 0x8000 40b26e484bSSami Tolvanen #define CFI_BRK_IMM_MASK (CFI_BRK_IMM_TARGET | CFI_BRK_IMM_TYPE) 41b26e484bSSami Tolvanen 42f98deee9SArd Biesheuvel #endif 43