From 217507eb035933bac6c990844f0d71d6000fd339 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Wed, 22 Sep 2021 18:32:45 -0400 Subject: runtime: set vdsoSP to caller's SP consistently m.vdsoSP should be set to the SP of the caller of nanotime1, instead of the SP of nanotime1 itself, which matches m.vdsoPC. Otherwise the unmatched vdsoPC and vdsoSP would make the stack trace look like recursive. We already do it correctly on AMD64, 386, and RISCV64. This CL fixes the rest. Fixes #47324. Change-Id: I98b6fcfbe9fc6bdd28b8fe2a1299b7c505371dd4 Reviewed-on: https://go-review.googlesource.com/c/go/+/337590 Trust: Cherry Mui Trust: Josh Bleecher Snyder Reviewed-by: Josh Bleecher Snyder --- src/runtime/sys_linux_mips64x.s | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/runtime/sys_linux_mips64x.s') diff --git a/src/runtime/sys_linux_mips64x.s b/src/runtime/sys_linux_mips64x.s index e18d291445..7529a0ed27 100644 --- a/src/runtime/sys_linux_mips64x.s +++ b/src/runtime/sys_linux_mips64x.s @@ -229,8 +229,9 @@ TEXT runtime·walltime(SB),NOSPLIT,$16-12 MOVV R2, 8(R29) MOVV R3, 16(R29) + MOVV $ret-8(FP), R2 // caller's SP MOVV R31, m_vdsoPC(R17) - MOVV R29, m_vdsoSP(R17) + MOVV R2, m_vdsoSP(R17) MOVV m_curg(R17), R4 MOVV g, R5 @@ -298,8 +299,9 @@ TEXT runtime·nanotime1(SB),NOSPLIT,$16-8 MOVV R2, 8(R29) MOVV R3, 16(R29) + MOVV $ret-8(FP), R2 // caller's SP MOVV R31, m_vdsoPC(R17) - MOVV R29, m_vdsoSP(R17) + MOVV R2, m_vdsoSP(R17) MOVV m_curg(R17), R4 MOVV g, R5 -- cgit v1.3-6-g1900