]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: avoid register clobber in s390x racecall
authorMichael Pratt <mpratt@google.com>
Wed, 21 May 2025 15:10:24 +0000 (11:10 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 18:05:32 +0000 (11:05 -0700)
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 <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/race_s390x.s

index a12bf8416b4820cda9c846e2dba408eacd55d407..3dfda9e733b09d915d4060a1ac4ae2cf1bc27e62 100644 (file)
@@ -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.