Date: Thu, 18 Dec 2025 18:40:48 +0000 From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 186154414173 - stable/15 - aarch64: Clarify the initial adjustments to sp for kernel exception entry Message-ID: <69444ab0.319b6.674101ec@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=186154414173eac06a2bbde4628cdecda520f22c commit 186154414173eac06a2bbde4628cdecda520f22c Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-09-16 11:21:39 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-12-18 18:24:15 +0000 aarch64: Clarify the initial adjustments to sp for kernel exception entry The first store-pair instruction in save_registers_head decrements the stack pointer to create room for most of the trapframe (and the redzone area for nested exceptions). However, the expression was a bit non-intuitive as it was using an expression without a leading negative sign to adjust the stack pointer. Rewrite the expression so that it is more clearly a negative adjustment to the stack pointer. Suggested by: andrew Reviewed by: andrew Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D52514 (cherry picked from commit 7314f78b240bdbf2bcec07e3d5a475e37941bb6b) --- sys/arm64/arm64/exception.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 13095def8b00..6e673fbe5a43 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -43,9 +43,9 @@ .macro save_registers_head el .if \el == 1 mov x18, sp - stp x0, x1, [sp, #(TF_X - TF_SIZE - 128)]! + stp x0, x1, [sp, #-(TF_SIZE - TF_X + 128)]! .else - stp x0, x1, [sp, #(TF_X - TF_SIZE)]! + stp x0, x1, [sp, #-(TF_SIZE - TF_X)]! .endif stp x2, x3, [sp, #(2 * 8)] stp x4, x5, [sp, #(4 * 8)]help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69444ab0.319b6.674101ec>
