Commit 44e752c3 authored by Keith Randall's avatar Keith Randall Committed by Keith Randall

runtime: fix ppc64le race code

This code is not currently compiling, the asm vet checks fail. When running race.bash on ppc64le, I get:

runtime/race_ppc64le.s:104:1: [ppc64le] RaceReadRange: wrong argument size 24; expected $...-16
runtime/race_ppc64le.s:514:1: [ppc64le] racecallbackthunk: unknown variable cmd; offset 0 is arg+0(FP)
runtime/race_ppc64le.s:515:1: [ppc64le] racecallbackthunk: unknown variable ctx

I'm also not sure why it ever worked; it looks like it is writing
the arguments to racecallback in the wrong place (the race detector
itself probably still works, it would just have trouble symbolizing
any resulting race report).

At a meta-level, we should really add a ppc64le/race builder.
Otherwise this code will rot, as evidenced by the rot this CL fixes :)

Update #33309

Change-Id: I3b49c2442aa78538fbb631a143a757389a1368fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/197337
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarLynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 6232dadc
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "go_tls.h" #include "go_tls.h"
#include "funcdata.h" #include "funcdata.h"
#include "textflag.h" #include "textflag.h"
#include "asm_ppc64x.h"
// The following functions allow calling the clang-compiled race runtime directly // The following functions allow calling the clang-compiled race runtime directly
// from Go code without going all the way through cgo. // from Go code without going all the way through cgo.
...@@ -101,7 +102,7 @@ TEXT runtime·racereadrangepc1(SB), NOSPLIT, $0-24 ...@@ -101,7 +102,7 @@ TEXT runtime·racereadrangepc1(SB), NOSPLIT, $0-24
MOVD $__tsan_read_range(SB), R8 MOVD $__tsan_read_range(SB), R8
BR racecalladdr<>(SB) BR racecalladdr<>(SB)
TEXT runtime·RaceReadRange(SB), NOSPLIT, $0-24 TEXT runtime·RaceReadRange(SB), NOSPLIT, $0-16
BR runtime·racereadrange(SB) BR runtime·racereadrange(SB)
// func runtime·RaceWriteRange(addr, size uintptr) // func runtime·RaceWriteRange(addr, size uintptr)
...@@ -467,9 +468,9 @@ rest: ...@@ -467,9 +468,9 @@ rest:
MOVD R10, 16(R1) MOVD R10, 16(R1)
MOVW CR, R10 MOVW CR, R10
MOVW R10, 8(R1) MOVW R10, 8(R1)
MOVDU R1, -336(R1) // Allocate frame needed for register save area MOVDU R1, -336(R1) // Allocate frame needed for outargs and register save area
MOVD R14, 40(R1) MOVD R14, 328(R1)
MOVD R15, 48(R1) MOVD R15, 48(R1)
MOVD R16, 56(R1) MOVD R16, 56(R1)
MOVD R17, 64(R1) MOVD R17, 64(R1)
...@@ -511,8 +512,8 @@ rest: ...@@ -511,8 +512,8 @@ rest:
MOVD g_m(g), R7 MOVD g_m(g), R7
MOVD m_g0(R7), g // set g = m-> g0 MOVD m_g0(R7), g // set g = m-> g0
MOVD R3, cmd+0(FP) // can't use R1 here ?? use input args and assumer caller expects those? MOVD R3, FIXED_FRAME+0(R1)
MOVD R4, ctx+8(FP) // can't use R1 here ?? MOVD R4, FIXED_FRAME+8(R1)
BL runtime·racecallback(SB) BL runtime·racecallback(SB)
// All registers are clobbered after Go code, reload. // All registers are clobbered after Go code, reload.
MOVD runtime·tls_g(SB), R10 MOVD runtime·tls_g(SB), R10
...@@ -520,7 +521,7 @@ rest: ...@@ -520,7 +521,7 @@ rest:
MOVD g_m(g), R7 MOVD g_m(g), R7
MOVD m_curg(R7), g // restore g = m->curg MOVD m_curg(R7), g // restore g = m->curg
MOVD 40(R1), R14 MOVD 328(R1), R14
MOVD 48(R1), R15 MOVD 48(R1), R15
MOVD 56(R1), R16 MOVD 56(R1), R16
MOVD 64(R1), R17 MOVD 64(R1), R17
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment