git: ed2d2423470d - stable/13 - Print registers on an arm64 spinlock data abort
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Sep 2023 11:00:52 UTC
The branch stable/13 has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=ed2d2423470d7bb74db1c9779834ee9c7e5d6486
commit ed2d2423470d7bb74db1c9779834ee9c7e5d6486
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-05-23 09:21:39 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-09-25 08:41:16 +0000
Print registers on an arm64 spinlock data abort
When checking if the spinlock count is correct in a data abort we can
panic without printing the registers. These are useful to debug the
abort, e.g. by giving the fault address register.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40228
(cherry picked from commit 0731b0a9f1f9e3b4ec699ec67b6eb24159fa9b05)
---
sys/arm64/arm64/trap.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index 10a2138d9625..45a4075507c3 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -299,8 +299,14 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr,
pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)
return;
- KASSERT(td->td_md.md_spinlock_count == 0,
- ("data abort with spinlock held"));
+#ifdef INVARIANTS
+ if (td->td_md.md_spinlock_count != 0) {
+ print_registers(frame);
+ print_gp_register("far", far);
+ printf(" esr: %.16lx\n", esr);
+ panic("data abort with spinlock held");
+ }
+#endif
if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK |
WARN_GIANTOK, NULL, "Kernel page fault") != 0) {
print_registers(frame);