Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 2025 11:24:49 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7314f78b240b - main - aarch64: Clarify the initial adjustments to sp for kernel exception entry
Message-ID:  <202509161124.58GBOnSx079939@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=7314f78b240bdbf2bcec07e3d5a475e37941bb6b

commit 7314f78b240bdbf2bcec07e3d5a475e37941bb6b
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-09-16 11:21:39 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-09-16 11:21:39 +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
---
 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)]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509161124.58GBOnSx079939>