Use correct byte-sized register constraint in __xchg_op()
PATCH 1/1 Use correct byte-sized register constraint in __xchg_op()
x86-64 can access the low half of any register, but i386 can only do it with a subset of registers. 'r' causes compilation failures on i386, but 'q' expresses the constraint properly.
arch/x86/include/asm/cmpxchg.h +1 -1
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void)switch (sizeof (*(ptr))) { \case __X86_CASE_B: \ asm volatile (lock #op "b %b0, %1\n" \ - :"+r" (__ret),"+m" (*(ptr)) \ + :"+q" (__ret),"+m" (*(ptr)) \ : :"memory" ,"cc" ); \break ; \case __X86_CASE_W: \
Quoted 7 lines · Jeremy Fitzhardinge
x86-64 can access the low half of any register, but i386 can only do it with a subset of registers. 'r' causes compilation failures on i386, but 'q' expresses the constraint properly.
Signed-off-by Jeremy Fitzhardinge <[email protected]>Reported-by Leigh Scott <[email protected]>Tested-by Thomas Reitmayr <[email protected]>
This should be CC'd to stable, given the bug shows up in 3.3, right?
josh
Quoted 10 lines · Josh Boyer
Quoted 7 lines · Jeremy Fitzhardinge
x86-64 can access the low half of any register, but i386 can only do it with a subset of registers. 'r' causes compilation failures on i386, but 'q' expresses the constraint properly.
Signed-off-by Jeremy Fitzhardinge <[email protected]>Reported-by Leigh Scott <[email protected]>Tested-by Thomas Reitmayr <[email protected]>This should be CC'd to stable, given the bug shows up in 3.3, right?
Er.. this patch seems to have been lost in limbo. Is anyone following up on it?
josh
Hi Josh,
You are right, this bug also affects 3.3 and IMO should be fixed there, too!
-Thomas
Am Donnerstag, den 05.04.2012, 16:27 -0400 schrieb Josh Boyer:
Quoted 17 lines · Josh Boyer
Quoted 10 lines · Jeremy Fitzhardinge
Quoted 7 lines
x86-64 can access the low half of any register, but i386 can only do it with a subset of registers. 'r' causes compilation failures on i386, but 'q' expresses the constraint properly.
Signed-off-by Jeremy Fitzhardinge <[email protected]>Reported-by Leigh Scott <[email protected]>Tested-by Thomas Reitmayr <[email protected]>This should be CC'd to stable, given the bug shows up in 3.3, right?
Er.. this patch seems to have been lost in limbo. Is anyone following up on it?
josh
PIng?
Quoted 29 lines · Jeremy Fitzhardinge
x86-64 can access the low half of any register, but i386 can only do it with a subset of registers. 'r' causes compilation failures on i386, but 'q' expresses the constraint properly.
Signed-off-by Jeremy Fitzhardinge <[email protected]>Reported-by Leigh Scott <[email protected]>Tested-by Thomas Reitmayr <[email protected]>arch/x86/include/asm/cmpxchg.h +1
-2@@ -43,7 +43,7 @@ extern void __add_wrong_size(void)switch (sizeof (*(ptr))) { \case __X86_CASE_B: \ asm volatile (lock #op "b %b0, %1\n" \ - :"+r" (__ret),"+m" (*(ptr)) \ + :"+q" (__ret),"+m" (*(ptr)) \ : :"memory" ,"cc" ); \break ; \case __X86_CASE_W: \ --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[tip:x86/urgent] x86: Use correct byte-sized register constraint in __xchg_op()
In reply to Jeremy FitzhardingeCommit-ID: 2ca052a3710fac208eee690faefdeb8bbd4586a1 Gitweb: http://git.kernel.org/tip/2ca052a3710fac208eee690faefdeb8bbd4586a1 Author: Jeremy Fitzhardinge <[email protected]> AuthorDate: Mon, 2 Apr 2012 16:15:33 -0700 Committer: H. Peter Anvin <[email protected]> CommitDate: Fri, 6 Apr 2012 09:39:39 -0700
x86: Use correct byte-sized register constraint in __xchg_op()
x86-64 can access the low half of any register, but i386 can only do it with a subset of registers. 'r' causes compilation failures on i386, but 'q' expresses the constraint properly.
--- arch/x86/include/asm/cmpxchg.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/include/asm/cmpxchg.h +1 -1
@@ -43,7 +43,7 @@ extern void __add_wrong_size(void)switch (sizeof (*(ptr))) { \case __X86_CASE_B: \ asm volatile (lock #op "b %b0, %1\n" \ - :"+r" (__ret),"+m" (*(ptr)) \ + :"+q" (__ret),"+m" (*(ptr)) \ : :"memory" ,"cc" ); \break ; \case __X86_CASE_W: \
tip-bot for H. Peter Anvin
reviewer[tip:x86/urgent] x86: Use correct byte-sized register constraint in __add()
In reply to Jeremy FitzhardingeCommit-ID: 8c91c5325e107ec17e40a59a47c6517387d64eb7 Gitweb: http://git.kernel.org/tip/8c91c5325e107ec17e40a59a47c6517387d64eb7 Author: H. Peter Anvin <[email protected]> AuthorDate: Fri, 6 Apr 2012 09:30:57 -0700 Committer: H. Peter Anvin <[email protected]> CommitDate: Fri, 6 Apr 2012 09:40:07 -0700
x86: Use correct byte-sized register constraint in __add()
Similar to:
2ca052a x86: Use correct byte-sized register constraint in __xchg_op()
... the __add() macro also needs to use a "q" constraint in the byte-sized case, lest we try to generate an illegal register.
--- arch/x86/include/asm/cmpxchg.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/include/asm/cmpxchg.h +1 -1
@@ -173,7 +173,7 @@ extern void __add_wrong_size(void)switch (sizeof (*(ptr))) { \case __X86_CASE_B: \ asmvolatile (lock"addb %b1, %0\n" \ - :"+m" (*(ptr)) :"ri" (inc) \ + :"+m" (*(ptr)) :"qi" (inc) \ :"memory" ,"cc" ); \break ; \case __X86_CASE_W: \