aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2018-05-16 06:52:08 +0000
committerAndriy Gapon <avg@FreeBSD.org>2018-05-16 06:52:08 +0000
commitc9c4d38aa84d87a4d24a7857e98bfa7b6dff1f68 (patch)
tree7a49954320f455faa2228bcb71d61f05ffc4534b /sys/arm64
parentd6b97a6497bf08a6caccfdb9d4980f197295ed9e (diff)
downloadsrc-c9c4d38aa84d87a4d24a7857e98bfa7b6dff1f68.tar.gz
src-c9c4d38aa84d87a4d24a7857e98bfa7b6dff1f68.zip
followup to r332730/r332752: set kdb_why to "trap" for fatal traps
This change updates arm, arm64 and mips achitectures. Additionally, it removes redundant checks for kdb_active where it already results in kdb_reenter() and adds kdb_reenter() calls where they were missing. Some architectures check the return value of kdb_trap(), but some don't. I haven't changed any of that. Some trap handling routines have a return code. I am not sure if I provided correct ones for returns after kdb_reenter(). kdb_reenter should never return unless kdb_jmpbufp is NULL for some reason. Only compile tested for all affected architectures. There can be bugs resulting from my poor understanding of architecture specific details. Reported by: jhb Reviewed by: jhb, eadler MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D15431
Notes
Notes: svn path=/head/; revision=333667
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/arm64/trap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index 71237bb98e4f..e0f2f448c445 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -156,6 +156,9 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr,
vm_prot_t ftype;
vm_offset_t va;
int error, sig, ucode;
+#ifdef KDB
+ bool handled;
+#endif
/*
* According to the ARMv8-A rev. A.g, B2.10.5 "Load-Exclusive
@@ -226,9 +229,14 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr,
printf(" esr: %.8lx\n", esr);
#ifdef KDB
- if (debugger_on_panic || kdb_active)
- if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame))
+ if (debugger_on_panic) {
+ kdb_why = KDB_WHY_TRAP;
+ handled = kdb_trap(ESR_ELx_EXCEPTION(esr), 0,
+ frame);
+ kdb_why = KDB_WHY_UNSET;
+ if (handled)
return;
+ }
#endif
panic("vm_fault failed: %lx", frame->tf_elr);
}