]> git.baikalelectronics.ru Git - kernel.git/commit
s390/cmpxchg: fix 1 and 2 byte memory accesses
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 29 May 2012 08:11:21 +0000 (10:11 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 30 May 2012 07:07:57 +0000 (09:07 +0200)
commit6710a05e2c39a719897f251c7d60992d96ab5a8b
tree3061cba9ea7ba20905ebb202a81c6da76debfe6d
parent2c64a0b7e2f598de026e36d0db47330c17769944
s390/cmpxchg: fix 1 and 2 byte memory accesses

When accessing a 1 or 2 byte memory operand we cannot use the
passed address since the compare and swap instruction only works
for 4 byte aligned memory operands.
Hence we calculate an aligned address so that compare and swap works
correctly. However we don't pass the calculated address to the inline
assembly. This results in incorrect memory accesses and in a
specification exception if used on non 4 byte aligned memory operands.

Since this didn't happen until now, there don't seem to be
too many users of cmpxchg on unaligned addresses.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/cmpxchg.h