From d2f229db7a3da4157fd7602f77513ce85c01ff04 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 21 May 2025 11:10:24 -0400 Subject: [PATCH] runtime: avoid register clobber in s390x racecall This is a regression in CL 643875. Loading gsignal clobbers R8, which contains the m pointer needed for loading g0. For #71395. Change-Id: I6a6a636ca95442767efe0eb1b358f2139d18c5b8 Reviewed-on: https://go-review.googlesource.com/c/go/+/675035 Auto-Submit: Michael Pratt LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- src/runtime/race_s390x.s | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runtime/race_s390x.s b/src/runtime/race_s390x.s index a12bf8416b..3dfda9e733 100644 --- a/src/runtime/race_s390x.s +++ b/src/runtime/race_s390x.s @@ -412,13 +412,13 @@ TEXT racecall<>(SB), NOSPLIT, $0-0 MOVD g_m(g), R8 // R8 = thread. // Switch to g0 stack if we aren't already on g0 or gsignal. - MOVD m_gsignal(R8), R8 - CMPBEQ R8, g, call + MOVD m_gsignal(R8), R9 + CMPBEQ R9, g, call - MOVD m_g0(R8), R8 - CMPBEQ R8, g, call + MOVD m_g0(R8), R9 + CMPBEQ R9, g, call - MOVD (g_sched+gobuf_sp)(R8), R15 // Switch SP to g0. + MOVD (g_sched+gobuf_sp)(R9), R15 // Switch SP to g0. call: SUB $160, R15 // Allocate C frame. BL R1 // Call C code. -- 2.50.0