]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.regabi] runtime: mark racecallbackthunk as ABIInternal
authorCherry Zhang <cherryyz@google.com>
Tue, 2 Feb 2021 23:09:03 +0000 (18:09 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 5 Feb 2021 16:52:30 +0000 (16:52 +0000)
racecallbackthunk is called from C, and it needs to follow C ABI.
The assembly code preserves C callee-save registers. It must not
be called via wrappers, which may not preserve those registers.

Change-Id: Icd72c399f4424d73c4882860d85057fe2671f6aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/289194
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/runtime/race_amd64.s

index 9818bc6ddff97e2366c80fb89cc4e4b3f2362c75..cf0a51462fd550cba0ee7edf0fc52a39e8cac09e 100644 (file)
@@ -419,7 +419,9 @@ call:
 // The overall effect of Go->C->Go call chain is similar to that of mcall.
 // RARG0 contains command code. RARG1 contains command-specific context.
 // See racecallback for command codes.
-TEXT   runtime·racecallbackthunk(SB), NOSPLIT, $56-8
+// Defined as ABIInternal so as to avoid introducing a wrapper,
+// because its address is passed to C via funcPC.
+TEXT   runtime·racecallbackthunk<ABIInternal>(SB), NOSPLIT, $56-8
        // Handle command raceGetProcCmd (0) here.
        // First, code below assumes that we are on curg, while raceGetProcCmd
        // can be executed on g0. Second, it is called frequently, so will