]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add arg storage to ppc64le/linux runtime.sigprofNonGoWrapper frame
authorPaul E. Murphy <murp@ibm.com>
Tue, 14 Mar 2023 21:30:38 +0000 (16:30 -0500)
committerPaul Murphy <murp@ibm.com>
Wed, 15 Mar 2023 13:30:09 +0000 (13:30 +0000)
CL 475935 fixed the the ELFv2 ABI violations, but in the process created a
Go ABI violation by failing to allocate stack space for arguments.

Allocate this space while keeping the frame 16 byte aligned.

Updates #58953

Change-Id: I9942d9a433118b391ef8cd7bcea5808695cf94d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/476296
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Archana Ravindar <aravind5@in.ibm.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/sys_linux_ppc64x.s

index 492a02bd380f25e4b399a9d3722a5f58e344f722..b8f3cfddebfa83444ceac97acae7bb3d217dfe5a 100644 (file)
@@ -747,22 +747,23 @@ TEXT runtime·sigprofNonGoWrapper<>(SB),NOSPLIT|NOFRAME,$0
        MOVW    CR, R0
        MOVD    R0, 8(R1)
        // Don't save a back chain pointer when calling into Go. It will be overwritten.
-       // Go stores LR where ELF stores a back chain pointer.
-       ADD     $-(32+SAVE_ALL_REG_SIZE), R1
+       // Go stores LR where ELF stores a back chain pointer.  And, allocate 64B for
+       // FIXED_FRAME and 24B argument space, rounded up to a 16 byte boundary.
+       ADD     $-(64+SAVE_ALL_REG_SIZE), R1
 
-       SAVE_GPR(32)
-       SAVE_FPR(32+SAVE_GPR_SIZE)
-       SAVE_VR(32+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
+       SAVE_GPR(64)
+       SAVE_FPR(64+SAVE_GPR_SIZE)
+       SAVE_VR(64+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
 
        MOVD    $0, R0
        CALL    runtime·sigprofNonGo<ABIInternal>(SB)
 
-       RESTORE_GPR(32)
-       RESTORE_FPR(32+SAVE_GPR_SIZE)
-       RESTORE_VR(32+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
+       RESTORE_GPR(64)
+       RESTORE_FPR(64+SAVE_GPR_SIZE)
+       RESTORE_VR(64+SAVE_GPR_SIZE+SAVE_FPR_SIZE, R6)
 
        // Clear frame, restore LR, return
-       ADD     $(32+SAVE_ALL_REG_SIZE), R1
+       ADD     $(64+SAVE_ALL_REG_SIZE), R1
        MOVD    16(R1), R0
        MOVD    R0, LR
        MOVD    8(R1), R0