]> Cypherpunks repositories - gostls13.git/commit
runtime: fix race atomic operations on external memory
authorDmitry Vyukov <dvyukov@google.com>
Wed, 29 Jun 2016 09:09:36 +0000 (11:09 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 29 Jun 2016 15:30:54 +0000 (15:30 +0000)
commitbb337372fb6e171a6e8a7665ce91eda734f8cdd2
treeb92f2da03d5a519be2f82499f085233319b2f542
parent25a609556aff7700c864f2dc69be01652fd801ab
runtime: fix race atomic operations on external memory

The assembly is broken: it does `MOVQ g(R12), R14` expecting that
R12 contains tls address, but it does not do get_tls(R12) before.
This magically works on linux: `MOVQ g(R12), R14` is compiled to
`mov %fs:0xfffffffffffffff8,%r14` which does not use R12.
But it crashes on windows.

Add explicit `get_tls(R12)`.

Fixes #16206

Change-Id: Ic1f21a6fef2473bcf9147de6646929781c9c1e98
Reviewed-on: https://go-review.googlesource.com/24590
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/race/race_linux_test.go [new file with mode: 0644]
src/runtime/race/race_windows_test.go [new file with mode: 0644]
src/runtime/race_amd64.s