git: 27e9c833bb8f - stable/14 - arm64: Add EL1 hardware breakpoint exceptions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 15 Jul 2024 12:38:05 UTC
The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=27e9c833bb8fdb87618649ae8193fe5485ccfdc3 commit 27e9c833bb8fdb87618649ae8193fe5485ccfdc3 Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2024-03-12 16:50:04 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2024-07-15 12:23:58 +0000 arm64: Add EL1 hardware breakpoint exceptions Reviewed by: jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44353 (cherry picked from commit c802b486ddfd796ea35b770148af9a5b0cd0ee64) --- sys/arm64/arm64/gdb_machdep.c | 1 + sys/arm64/arm64/trap.c | 2 ++ sys/arm64/include/armreg.h | 1 + sys/arm64/include/db_machdep.h | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gdb_machdep.c b/sys/arm64/arm64/gdb_machdep.c index dcfc91b33eb7..7b21675ea927 100644 --- a/sys/arm64/arm64/gdb_machdep.c +++ b/sys/arm64/arm64/gdb_machdep.c @@ -110,6 +110,7 @@ gdb_cpu_signal(int type, int code __unused) switch (type) { case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: + case EXCP_BRKPT_EL1: case EXCP_BRK: return (SIGTRAP); } diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 50f930b66664..69c5cd73ade8 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -498,6 +498,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) */ switch (exception) { case EXCP_BRK: + case EXCP_BRKPT_EL1: case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: break; @@ -549,6 +550,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) panic("No debugger in kernel."); #endif break; + case EXCP_BRKPT_EL1: case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 6f9e109f4b70..b2dfd61c3083 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -439,6 +439,7 @@ #define EXCP_TRAP_FP 0x2c /* Trapped FP exception */ #define EXCP_SERROR 0x2f /* SError interrupt */ #define EXCP_BRKPT_EL0 0x30 /* Hardware breakpoint, from same EL */ +#define EXCP_BRKPT_EL1 0x31 /* Hardware breakpoint, from same EL */ #define EXCP_SOFTSTP_EL0 0x32 /* Software Step, from lower EL */ #define EXCP_SOFTSTP_EL1 0x33 /* Software Step, from same EL */ #define EXCP_WATCHPT_EL0 0x34 /* Watchpoint, from lower EL */ diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index f1f638a7882c..45b97443aec5 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -36,6 +36,7 @@ #include <machine/trap.h> #define T_BREAKPOINT (EXCP_BRK) +#define T_HW_BREAKPOINT (EXCP_BRKPT_EL1) #define T_SINGLESTEP (EXCP_SOFTSTP_EL1) #define T_WATCHPOINT (EXCP_WATCHPT_EL1) @@ -56,7 +57,8 @@ typedef long db_expr_t; #define db_clear_single_step kdb_cpu_clear_singlestep #define db_set_single_step kdb_cpu_set_singlestep -#define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT) +#define IS_BREAKPOINT_TRAP(type, code) \ + (type == T_BREAKPOINT || type == T_HW_BREAKPOINT) #define IS_SSTEP_TRAP(type, code) (type == T_SINGLESTEP) #define IS_WATCHPOINT_TRAP(type, code) (type == T_WATCHPOINT)