Date: Tue, 04 Aug 2026 10:39:25 +0000 From: Olivier Houchard <cognet@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 35d56f200e94 - stable/14 - arm64: Use the fault handler when one is provided Message-ID: <6a71c15d.4503d.43461753@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by cognet: URL: https://cgit.FreeBSD.org/src/commit/?id=35d56f200e94336d5f3baac7f124fbe93f82a98e commit 35d56f200e94336d5f3baac7f124fbe93f82a98e Author: Olivier Houchard <cognet@FreeBSD.org> AuthorDate: 2026-07-23 23:47:21 +0000 Commit: Olivier Houchard <cognet@FreeBSD.org> CommitDate: 2026-08-04 10:28:40 +0000 arm64: Use the fault handler when one is provided In align_abort() and tag_check_abort(), if we got a fault while in kernel, do not panic if a fault handler has been provided. We may get such a fault when trying to read or write userland data, it can at least happen with _umtx_op() if an unaligned pointer is provided. Instead, just let the fault handler deal with it. MFC After: 1 week Approved by: andrew Differential Revision: https://reviews.freebsd.org/D58426 (cherry picked from commit c6f5d8fb269fd67a8206420b4e7d67a93bc80733) Signed-off-by: Olivier Houchard <cognet@FreeBSD.org> (cherry picked from commit 60dd46db19f473af7aa505c0d8dcf9bb69847019) Signed-off-by: Olivier Houchard <cognet@FreeBSD.org> --- sys/arm64/arm64/trap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 9f792332a931..6292522ae67b 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -212,6 +212,17 @@ align_abort(struct thread *td, struct trapframe *frame, uint64_t esr, uint64_t far, int lower) { if (!lower) { + /* + * Accessing unaligned memory may fault when using atomics. + * Make sure we don't panic if we're doing an unaligned + * access to userland memory, as can happen with _umtx_op() + */ + if (td->td_intr_nesting_level == 0 && + td->td_pcb->pcb_onfault != 0) { + frame->tf_elr = td->td_pcb->pcb_onfault; + return; + } + print_registers(frame); print_gp_register("far", far); printf(" esr: 0x%.16lx\n", esr);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a71c15d.4503d.43461753>
