Skip to content

Commit 9d6b678

Browse files
Anshuman Khandualctmarinas
authored andcommitted
arm64/hw_breakpoint: Directly use ESR_ELx_WNR for an watchpoint exception
Let's use existing ISS encoding for an watchpoint exception i.e ESR_ELx_WNR This represents an instruction's either writing to or reading from a memory location during an watchpoint exception. While here this drops non-standard macro AARCH64_ESR_ACCESS_MASK. Cc: Will Deacon <[email protected]> Cc: Mark Rutland <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 6224426 commit 9d6b678

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm64/include/asm/hw_breakpoint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ static inline void decode_ctrl_reg(u32 reg,
5959
/* Watchpoints */
6060
#define ARM_BREAKPOINT_LOAD 1
6161
#define ARM_BREAKPOINT_STORE 2
62-
#define AARCH64_ESR_ACCESS_MASK (1 << 6)
6362

6463
/* Lengths */
6564
#define ARM_BREAKPOINT_LEN_1 0x1

arch/arm64/kernel/hw_breakpoint.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <asm/current.h>
2323
#include <asm/debug-monitors.h>
24+
#include <asm/esr.h>
2425
#include <asm/hw_breakpoint.h>
2526
#include <asm/traps.h>
2627
#include <asm/cputype.h>
@@ -779,7 +780,7 @@ static int watchpoint_handler(unsigned long addr, unsigned long esr,
779780
* Check that the access type matches.
780781
* 0 => load, otherwise => store
781782
*/
782-
access = (esr & AARCH64_ESR_ACCESS_MASK) ? HW_BREAKPOINT_W :
783+
access = (esr & ESR_ELx_WNR) ? HW_BREAKPOINT_W :
783784
HW_BREAKPOINT_R;
784785
if (!(access & hw_breakpoint_type(wp)))
785786
continue;

0 commit comments

Comments
 (0)