Skip to content

Commit

Permalink
runtime: make racereadrange ABIinternal
Browse files Browse the repository at this point in the history
CL 266638 marked racewriterange (and some other race functions) as
ABIinternal but missed racereadrange.

arm64 and ppc64le (the other two register ABI platforms at the moment)
already have racereadrange marked as such.

The other two instrumented calls are to racefuncenter/racefuncexit.
Do you think they would need this treatment as well? arm64 already does,
but amd64 and ppc64le do not.

Fixes #51459

Change-Id: I3f54e1298433b6d67bfe18120d9f86205ff66a73
Reviewed-on: https://go-review.googlesource.com/c/go/+/393154
Reviewed-by: Than McIntosh <[email protected]>
Run-TryBot: Keith Randall <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
  • Loading branch information
randall77 committed May 9, 2022
1 parent 9ae7dc3 commit f566fe3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/runtime/race_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ TEXT runtime·racewritepc(SB), NOSPLIT, $0-24

// func runtime·racereadrange(addr, size uintptr)
// Called from instrumented code.
TEXT runtime·racereadrange(SB), NOSPLIT, $0-16
MOVQ addr+0(FP), RARG1
MOVQ size+8(FP), RARG2
// Defined as ABIInternal so as to avoid introducing a wrapper,
// which would render runtime.getcallerpc ineffective.
TEXT runtime·racereadrange<ABIInternal>(SB), NOSPLIT, $0-16
MOVQ AX, RARG1
MOVQ BX, RARG2
MOVQ (SP), RARG3
// void __tsan_read_range(ThreadState *thr, void *addr, uintptr size, void *pc);
MOVQ $__tsan_read_range(SB), AX
Expand Down

0 comments on commit f566fe3

Please sign in to comment.