The branch main has been updated by jhibbits:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=645bb3efc3209a9ca6dfabb48b1c6475c1d965a9

commit 645bb3efc3209a9ca6dfabb48b1c6475c1d965a9
Author:     Timothy Pearson <tpear...@raptorengineering.com>
AuthorDate: 2025-07-06 19:24:07 +0000
Commit:     Justin Hibbits <jhibb...@freebsd.org>
CommitDate: 2025-07-13 18:00:56 +0000

    powerpc: Reserve correct scratch region size below stack
    
    According to the ELF ABI v2, two scratch regions are reserved below the 
stack
    pointer, one 288 byte general region and one 224 byte compiler region.
    
    FreeBSD only reserved the 288 byte region.  Follow the ELV v2 ABI and 
reserve
    the full 512 byte region as specified.
    
    Signed-off-by: Timothy Pearson <tpear...@raptorengineering.com>
    
    MFC after:      1 week
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/1756
---
 sys/powerpc/powerpc/exec_machdep.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/powerpc/powerpc/exec_machdep.c 
b/sys/powerpc/powerpc/exec_machdep.c
index 1893d79f29a8..c6b2b01d9d30 100644
--- a/sys/powerpc/powerpc/exec_machdep.c
+++ b/sys/powerpc/powerpc/exec_machdep.c
@@ -214,10 +214,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
                sfpsize = sizeof(sf);
                #ifdef __powerpc64__
                /*
-                * 64-bit PPC defines a 288 byte scratch region
-                * below the stack.
+                * 64-bit PPC defines a 512 byte red zone below
+                * the existing stack (ELF ABI v2 ยง2.2.2.4)
                 */
-               rndfsize = 288 + roundup(sizeof(sf), 48);
+               rndfsize = 512 + roundup(sizeof(sf), 48);
                #else
                rndfsize = roundup(sizeof(sf), 16);
                #endif

Reply via email to