linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: cmpxchg_double: Add missing memory clobber
@ 2015-10-06 18:54 Pranith Kumar
  2015-10-06 20:16 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Pranith Kumar @ 2015-10-06 18:54 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)

We are reading from memory locations pointed to by p1 and p2 in the asm
block. Add a memory clobber flag to make gcc aware of this.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 arch/x86/include/asm/cmpxchg.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index 4a2e5bc..3e83949 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -214,7 +214,8 @@ extern void __add_wrong_size(void)
 		     : "=a" (__ret), "+d" (__old2),			\
 		       "+m" (*(p1)), "+m" (*(p2))			\
 		     : "i" (2 * sizeof(long)), "a" (__old1),		\
-		       "b" (__new1), "c" (__new2));			\
+		       "b" (__new1), "c" (__new2)			\
+		     : "memory");					\
 	__ret;								\
 })
 
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-07 13:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 18:54 [PATCH] x86: cmpxchg_double: Add missing memory clobber Pranith Kumar
2015-10-06 20:16 ` H. Peter Anvin
2015-10-06 20:29   ` Pranith Kumar
2015-10-06 21:39     ` H. Peter Anvin
2015-10-07 13:00       ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).