]> git.baikalelectronics.ru Git - kernel.git/commit
x86: Add memory modify constraints to xchg() and cmpxchg()
authorH. Peter Anvin <hpa@zytor.com>
Wed, 28 Jul 2010 00:01:49 +0000 (17:01 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 28 Jul 2010 00:14:02 +0000 (17:14 -0700)
commitf7df072de31f7a01a10b8af248b44610202f310a
tree84393467b2174c05e7240db72ffa55ce3da67a70
parent778fb3c0904925de0d79d149c8348158672b7006
x86: Add memory modify constraints to xchg() and cmpxchg()

xchg() and cmpxchg() modify their memory operands, not merely read
them.  For some versions of gcc the "memory" clobber has apparently
dealt with the situation, but not for all.

Originally-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Glauber Costa <glommer@redhat.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Peter Palfrader <peter@palfrader.org>
Cc: Greg KH <gregkh@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Zachary Amsden <zamsden@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: <stable@kernel.org>
LKML-Reference: <4C4F7277.8050306@zytor.com>
arch/x86/include/asm/cmpxchg_32.h
arch/x86/include/asm/cmpxchg_64.h