]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make racereadrange ABIinternal
authorKeith Randall <khr@golang.org>
Tue, 15 Mar 2022 20:03:39 +0000 (13:03 -0700)
committerKeith Randall <khr@google.com>
Mon, 9 May 2022 16:59:57 +0000 (16:59 +0000)
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 <thanm@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/runtime/race_amd64.s

index f055acf77dd3edd69b38f9eadd0fb93b152d34b5..c679a876b8d5eab4a1383067ab8dfefb83473a58 100644 (file)
@@ -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