aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2025-07-02 23:26:44 -0400
committerCherry Mui <cherryyz@google.com>2025-07-03 18:43:56 -0700
commit6c3b5a2798c83d583cb37dba9f39c47300d19f1f (patch)
treea98b960d15aeda6533ef766cbc12eac2adb9d8b4 /src
parentdd687c386016445b2f4abc2a958963dd2056d95f (diff)
downloadgo-6c3b5a2798c83d583cb37dba9f39c47300d19f1f.tar.xz
runtime: correct vdsoSP on S390X
It should get the caller's SP. The current code gets the address of the first parameter, which is one word above the caller's SP. There is a slot for saving the LR at 0(SP) in the caller's frame. Fixes #62086 (for s390x). Change-Id: Ie8cbfabc8161b98658c884a32e0af72df189ea56 Reviewed-on: https://go-review.googlesource.com/c/go/+/685715 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/sys_linux_s390x.s4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/sys_linux_s390x.s b/src/runtime/sys_linux_s390x.s
index 2f9d4beda8..a3472a4508 100644
--- a/src/runtime/sys_linux_s390x.s
+++ b/src/runtime/sys_linux_s390x.s
@@ -226,7 +226,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$32-12
MOVD R4, 24(R15)
MOVD R14, R8 // Backup return address
- MOVD $sec+0(FP), R4 // return parameter caller
+ MOVD $ret-8(FP), R4 // caller's SP
MOVD R8, m_vdsoPC(R6)
MOVD R4, m_vdsoSP(R6)
@@ -312,7 +312,7 @@ TEXT runtime·nanotime1(SB),NOSPLIT,$32-8
MOVD R4, 24(R15)
MOVD R14, R8 // Backup return address
- MOVD $ret+0(FP), R4 // caller's SP
+ MOVD $ret-8(FP), R4 // caller's SP
MOVD R8, m_vdsoPC(R6)
MOVD R4, m_vdsoSP(R6)