[PATCH] powerpc: use lwsync in atomics, bitops, lock functions
authorAnton Blanchard <anton@samba.org>
Fri, 13 Jan 2006 04:37:17 +0000 (15:37 +1100)
committerPaul Mackerras <paulus@samba.org>
Fri, 13 Jan 2006 10:18:50 +0000 (21:18 +1100)
commit144b9c135b963bcb7f242c7b83bff930620d3161
tree4b454f3e5e5921c5a528131dfa51df542259d918
parent3356bb9f7ba378a6e2709f9df95f4ea52111f4df
[PATCH] powerpc: use lwsync in atomics, bitops, lock functions

eieio is only a store - store ordering. When used to order an unlock
operation loads may leak out of the critical region. This is potentially
buggy, one example is if a user wants to atomically read a couple of
values.

We can solve this with an lwsync which orders everything except store - load.

I removed the (now unused) EIEIO_ON_SMP macros and the c versions
isync_on_smp and eieio_on_smp now we dont use them. I also removed some
old comments that were used to identify inline spinlocks in assembly,
they dont make sense now our locks are out of line.

Another interesting thing was that read_unlock was using an eieio even
though the rest of the spinlock code had already been converted to
use lwsync.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
include/asm-powerpc/atomic.h
include/asm-powerpc/bitops.h
include/asm-powerpc/futex.h
include/asm-powerpc/spinlock.h
include/asm-powerpc/synch.h
include/asm-powerpc/system.h