aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/race_ppc64le.s
diff options
context:
space:
mode:
authorKeith Randall <khr@google.com>2019-09-25 13:24:54 -0700
committerKeith Randall <khr@golang.org>2019-09-25 21:39:33 +0000
commit44e752c38ad507fd2725f58ae58802b39b45f1d8 (patch)
treeaba34c1f4faa6c970b947241637e59919a66eb25 /src/runtime/race_ppc64le.s
parent6232dadc63dda3e6f8ce227ed7e003da80f5ba2e (diff)
downloadgo-44e752c38ad507fd2725f58ae58802b39b45f1d8.tar.gz
go-44e752c38ad507fd2725f58ae58802b39b45f1d8.zip
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: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/race_ppc64le.s')
-rw-r--r--src/runtime/race_ppc64le.s13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/runtime/race_ppc64le.s b/src/runtime/race_ppc64le.s
index 79b8ba2ae8..0486bb338b 100644
--- a/src/runtime/race_ppc64le.s
+++ b/src/runtime/race_ppc64le.s
@@ -8,6 +8,7 @@
#include "go_tls.h"
#include "funcdata.h"
#include "textflag.h"
+#include "asm_ppc64x.h"
// The following functions allow calling the clang-compiled race runtime directly
// from Go code without going all the way through cgo.
@@ -101,7 +102,7 @@ TEXT runtime·racereadrangepc1(SB), NOSPLIT, $0-24
MOVD $__tsan_read_range(SB), R8
BR racecalladdr<>(SB)
-TEXT runtime·RaceReadRange(SB), NOSPLIT, $0-24
+TEXT runtime·RaceReadRange(SB), NOSPLIT, $0-16
BR runtime·racereadrange(SB)
// func runtime·RaceWriteRange(addr, size uintptr)
@@ -467,9 +468,9 @@ rest:
MOVD R10, 16(R1)
MOVW CR, R10
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 R16, 56(R1)
MOVD R17, 64(R1)
@@ -511,8 +512,8 @@ rest:
MOVD g_m(g), R7
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 R4, ctx+8(FP) // can't use R1 here ??
+ MOVD R3, FIXED_FRAME+0(R1)
+ MOVD R4, FIXED_FRAME+8(R1)
BL runtime·racecallback(SB)
// All registers are clobbered after Go code, reload.
MOVD runtime·tls_g(SB), R10
@@ -520,7 +521,7 @@ rest:
MOVD g_m(g), R7
MOVD m_curg(R7), g // restore g = m->curg
- MOVD 40(R1), R14
+ MOVD 328(R1), R14
MOVD 48(R1), R15
MOVD 56(R1), R16
MOVD 64(R1), R17