Skip to content

Commit bebe668

Browse files
candleseaRussell King
authored andcommitted
ARM: 8927/1: ARM/hw_breakpoint: add more ARMv8 debug architecture versions support
When ARMv8 cores are used in AArch32 mode, arch_hw_breakpoint_init() in arch/arm/kernel/hw_breakpoint.c will be used. From ARMv8 specification, v8 debug architecture versions defined: * 0110 ARMv8, v8 Debug architecture. * 0111 ARMv8.1, v8 Debug architecture, with Virtualization Host Extensions. * 1000 ARMv8.2, v8.2 Debug architecture. * 1001 ARMv8.4, v8.4 Debug architecture. So missing ARMv8.1/ARMv8.2/ARMv8.4 cases will cause enable_monitor_mode() returns -ENODEV,and eventually arch_hw_breakpoint_init() will fail. Signed-off-by: Candle Sun <[email protected]> Signed-off-by: Nianfu Bai <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent fb033c9 commit bebe668

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

arch/arm/include/asm/hw_breakpoint.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ static inline void decode_ctrl_reg(u32 reg,
5353
#define ARM_DEBUG_ARCH_V7_MM 4
5454
#define ARM_DEBUG_ARCH_V7_1 5
5555
#define ARM_DEBUG_ARCH_V8 6
56+
#define ARM_DEBUG_ARCH_V8_1 7
57+
#define ARM_DEBUG_ARCH_V8_2 8
58+
#define ARM_DEBUG_ARCH_V8_4 9
5659

5760
/* Breakpoint */
5861
#define ARM_BREAKPOINT_EXECUTE 0

arch/arm/kernel/hw_breakpoint.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ static int enable_monitor_mode(void)
246246
case ARM_DEBUG_ARCH_V7_ECP14:
247247
case ARM_DEBUG_ARCH_V7_1:
248248
case ARM_DEBUG_ARCH_V8:
249+
case ARM_DEBUG_ARCH_V8_1:
250+
case ARM_DEBUG_ARCH_V8_2:
251+
case ARM_DEBUG_ARCH_V8_4:
249252
ARM_DBG_WRITE(c0, c2, 2, (dscr | ARM_DSCR_MDBGEN));
250253
isb();
251254
break;

0 commit comments

Comments
 (0)