Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: move AARCH64_BREAK_FAULT into insn-def.h

If CONFIG_ARM64_LSE_ATOMICS is off, encoders for LSE-related instructions
can return AARCH64_BREAK_FAULT directly in insn.h. In order to access
AARCH64_BREAK_FAULT in insn.h, we can not include debug-monitors.h in
insn.h, because debug-monitors.h has already depends on insn.h, so just
move AARCH64_BREAK_FAULT into insn-def.h.

It will be used by the following patch to eliminate unnecessary LSE-related
encoders when CONFIG_ARM64_LSE_ATOMICS is off.

Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20220217072232.1186625-2-houtao1@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Hou Tao and committed by
Will Deacon
97e58e39 a6aab018

+14 -12
-12
arch/arm64/include/asm/debug-monitors.h
··· 34 34 */ 35 35 #define BREAK_INSTR_SIZE AARCH64_INSN_SIZE 36 36 37 - /* 38 - * BRK instruction encoding 39 - * The #imm16 value should be placed at bits[20:5] within BRK ins 40 - */ 41 - #define AARCH64_BREAK_MON 0xd4200000 42 - 43 - /* 44 - * BRK instruction for provoking a fault on purpose 45 - * Unlike kgdb, #imm16 value with unallocated handler is used for faulting. 46 - */ 47 - #define AARCH64_BREAK_FAULT (AARCH64_BREAK_MON | (FAULT_BRK_IMM << 5)) 48 - 49 37 #define AARCH64_BREAK_KGDB_DYN_DBG \ 50 38 (AARCH64_BREAK_MON | (KGDB_DYN_DBG_BRK_IMM << 5)) 51 39
+14
arch/arm64/include/asm/insn-def.h
··· 3 3 #ifndef __ASM_INSN_DEF_H 4 4 #define __ASM_INSN_DEF_H 5 5 6 + #include <asm/brk-imm.h> 7 + 6 8 /* A64 instructions are always 32 bits. */ 7 9 #define AARCH64_INSN_SIZE 4 10 + 11 + /* 12 + * BRK instruction encoding 13 + * The #imm16 value should be placed at bits[20:5] within BRK ins 14 + */ 15 + #define AARCH64_BREAK_MON 0xd4200000 16 + 17 + /* 18 + * BRK instruction for provoking a fault on purpose 19 + * Unlike kgdb, #imm16 value with unallocated handler is used for faulting. 20 + */ 21 + #define AARCH64_BREAK_FAULT (AARCH64_BREAK_MON | (FAULT_BRK_IMM << 5)) 8 22 9 23 #endif /* __ASM_INSN_DEF_H */