aboutsummaryrefslogtreecommitdiff
path: root/src/sync/atomic/asm_linux_arm.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-12-22 22:50:42 -0500
committerRuss Cox <rsc@golang.org>2015-01-06 00:27:06 +0000
commit7b4df8f018ec01df3ecbd9961c769e7199853363 (patch)
tree08d6f4c8dcd3d95cd2418fe94445edab7025f158 /src/sync/atomic/asm_linux_arm.s
parenteafc482d4f091c4ddd2178098d94831d1e2f25ab (diff)
downloadgo-7b4df8f018ec01df3ecbd9961c769e7199853363.tar.xz
runtime, sync/atomic: add write barrier for atomic write of pointer
Add write barrier to atomic operations manipulating pointers. In general an atomic write of a pointer word may indicate racy accesses, so there is no strictly safe way to attempt to keep the shadow copy in sync with the real one. Instead, mark the shadow copy as not used. Redirect sync/atomic pointer routines back to the runtime ones, so that there is only one copy of the write barrier and shadow logic. In time we might consider doing this for most of the sync/atomic functions, but for now only the pointer routines need that treatment. Found with GODEBUG=wbshadow=1 mode. Eventually that will run automatically, but right now it still detects other missing write barriers. Change-Id: I852936b9a111a6cb9079cfaf6bd78b43016c0242 Reviewed-on: https://go-review.googlesource.com/2066 Reviewed-by: Rick Hudson <rlh@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/sync/atomic/asm_linux_arm.s')
-rw-r--r--src/sync/atomic/asm_linux_arm.s9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/sync/atomic/asm_linux_arm.s b/src/sync/atomic/asm_linux_arm.s
index 944758441a..b388e4c550 100644
--- a/src/sync/atomic/asm_linux_arm.s
+++ b/src/sync/atomic/asm_linux_arm.s
@@ -57,9 +57,6 @@ cascheck:
TEXT ·CompareAndSwapUintptr(SB),NOSPLIT,$0
B ·CompareAndSwapUint32(SB)
-TEXT ·CompareAndSwapPointer(SB),NOSPLIT,$0
- B ·CompareAndSwapUint32(SB)
-
TEXT ·AddInt32(SB),NOSPLIT,$0
B ·AddUint32(SB)
@@ -97,9 +94,6 @@ swaploop1:
TEXT ·SwapUintptr(SB),NOSPLIT,$0
B ·SwapUint32(SB)
-TEXT ·SwapPointer(SB),NOSPLIT,$0
- B ·SwapUint32(SB)
-
TEXT cas64<>(SB),NOSPLIT,$0
MOVW $0xffff0f60, PC // __kuser_cmpxchg64: Linux-3.1 and above
@@ -211,6 +205,3 @@ TEXT ·StoreUint64(SB),NOSPLIT,$0
TEXT ·StoreUintptr(SB),NOSPLIT,$0
B ·StoreUint32(SB)
-
-TEXT ·StorePointer(SB),NOSPLIT,$0
- B ·StoreUint32(SB)