2b52cb3
From: Jeremy Fitzhardinge <jeremy@goop.org>
2b52cb3
Date: Mon, 2 Apr 2012 23:15:33 +0000 (-0700)
2b52cb3
Subject: x86: Use correct byte-sized register constraint in __xchg_op()
2b52cb3
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftip%2Ftip.git;a=commitdiff_plain;h=2ca052a3710fac208eee690faefdeb8bbd4586a1
2b52cb3
2b52cb3
x86: Use correct byte-sized register constraint in __xchg_op()
2b52cb3
2b52cb3
x86-64 can access the low half of any register, but i386 can only do
2b52cb3
it with a subset of registers.  'r' causes compilation failures on i386,
2b52cb3
but 'q' expresses the constraint properly.
2b52cb3
2b52cb3
Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2b52cb3
Link: http://lkml.kernel.org/r/4F7A3315.501@goop.org
2b52cb3
Reported-by: Leigh Scott <leigh123linux@googlemail.com>
2b52cb3
Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
2b52cb3
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2b52cb3
Cc: <stable@vger.kernel.org> v3.3
2b52cb3
---
2b52cb3
2b52cb3
diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
2b52cb3
index b3b7332..bc18d0e 100644
2b52cb3
--- a/arch/x86/include/asm/cmpxchg.h
2b52cb3
+++ b/arch/x86/include/asm/cmpxchg.h
2b52cb3
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void)
2b52cb3
 		switch (sizeof(*(ptr))) {				\
2b52cb3
 		case __X86_CASE_B:					\
2b52cb3
 			asm volatile (lock #op "b %b0, %1\n"		\
2b52cb3
-				      : "+r" (__ret), "+m" (*(ptr))	\
2b52cb3
+				      : "+q" (__ret), "+m" (*(ptr))	\
2b52cb3
 				      : : "memory", "cc");		\
2b52cb3
 			break;						\
2b52cb3
 		case __X86_CASE_W:					\