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

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 <candle.sun@unisoc.com>
Signed-off-by: Nianfu Bai <nianfu.bai@unisoc.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by

Candle Sun and committed by
Russell King
bebe668e fb033c95

+6
+3
arch/arm/include/asm/hw_breakpoint.h
··· 53 53 #define ARM_DEBUG_ARCH_V7_MM 4 54 54 #define ARM_DEBUG_ARCH_V7_1 5 55 55 #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 56 59 57 60 /* Breakpoint */ 58 61 #define ARM_BREAKPOINT_EXECUTE 0
+3
arch/arm/kernel/hw_breakpoint.c
··· 246 246 case ARM_DEBUG_ARCH_V7_ECP14: 247 247 case ARM_DEBUG_ARCH_V7_1: 248 248 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: 249 252 ARM_DBG_WRITE(c0, c2, 2, (dscr | ARM_DSCR_MDBGEN)); 250 253 isb(); 251 254 break;