linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use correct byte-sized register constraint in __xchg_op()
@ 2012-04-02 23:15 Jeremy Fitzhardinge
  2012-04-04  0:37 ` Josh Boyer
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2012-04-02 23:15 UTC (permalink / raw)
  To: the arch/x86 maintainers
  Cc: Linux Kernel Mailing List, Thomas Reitmayr, leigh123linux, Dave Jones

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 <jeremy@goop.org>
Reported-by: Leigh Scott <leigh123linux@googlemail.com>
Tested-by: Thomas Reitmayr <treitmayr@devbase.at>

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index b3b7332..bc18d0e 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -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:					\



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

* Re: [PATCH] Use correct byte-sized register constraint in __xchg_op()
  2012-04-02 23:15 [PATCH] Use correct byte-sized register constraint in __xchg_op() Jeremy Fitzhardinge
@ 2012-04-04  0:37 ` Josh Boyer
  2012-04-05 20:27   ` Josh Boyer
  2012-04-06  7:46 ` Jeremy Fitzhardinge
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Josh Boyer @ 2012-04-04  0:37 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: the arch/x86 maintainers, Linux Kernel Mailing List,
	Thomas Reitmayr, leigh123linux, Dave Jones

On Mon, Apr 2, 2012 at 7:15 PM, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> 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 <jeremy@goop.org>
> Reported-by: Leigh Scott <leigh123linux@googlemail.com>
> Tested-by: Thomas Reitmayr <treitmayr@devbase.at>

This should be CC'd to stable, given the bug shows up in 3.3, right?

josh

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

* Re: [PATCH] Use correct byte-sized register constraint in __xchg_op()
  2012-04-04  0:37 ` Josh Boyer
@ 2012-04-05 20:27   ` Josh Boyer
  2012-04-05 21:16     ` Thomas Reitmayr
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Boyer @ 2012-04-05 20:27 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: the arch/x86 maintainers, Linux Kernel Mailing List,
	Thomas Reitmayr, leigh123linux, Dave Jones

On Tue, Apr 3, 2012 at 8:37 PM, Josh Boyer <jwboyer@gmail.com> wrote:
> On Mon, Apr 2, 2012 at 7:15 PM, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>> 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 <jeremy@goop.org>
>> Reported-by: Leigh Scott <leigh123linux@googlemail.com>
>> Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
>
> 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

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

* Re: [PATCH] Use correct byte-sized register constraint in __xchg_op()
  2012-04-05 20:27   ` Josh Boyer
@ 2012-04-05 21:16     ` Thomas Reitmayr
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Reitmayr @ 2012-04-05 21:16 UTC (permalink / raw)
  To: Josh Boyer
  Cc: Jeremy Fitzhardinge, the arch/x86 maintainers,
	Linux Kernel Mailing List, leigh123linux, Dave Jones

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:
> On Tue, Apr 3, 2012 at 8:37 PM, Josh Boyer <jwboyer@gmail.com> wrote:
> > On Mon, Apr 2, 2012 at 7:15 PM, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> >> 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 <jeremy@goop.org>
> >> Reported-by: Leigh Scott <leigh123linux@googlemail.com>
> >> Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
> >
> > 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
> 



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

* Re: [PATCH] Use correct byte-sized register constraint in __xchg_op()
  2012-04-02 23:15 [PATCH] Use correct byte-sized register constraint in __xchg_op() Jeremy Fitzhardinge
  2012-04-04  0:37 ` Josh Boyer
@ 2012-04-06  7:46 ` Jeremy Fitzhardinge
  2012-04-06 16:52 ` [tip:x86/urgent] x86: " tip-bot for Jeremy Fitzhardinge
  2012-04-06 16:53 ` [tip:x86/urgent] x86: Use correct byte-sized register constraint in __add() tip-bot for H. Peter Anvin
  3 siblings, 0 replies; 7+ messages in thread
From: Jeremy Fitzhardinge @ 2012-04-06  7:46 UTC (permalink / raw)
  To: the arch/x86 maintainers
  Cc: Linux Kernel Mailing List, Thomas Reitmayr, leigh123linux,
	Dave Jones, H. Peter Anvin, Ingo Molnar, Thomas Gleixner

PIng?

On 04/02/2012 04:15 PM, Jeremy Fitzhardinge wrote:
> 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 <jeremy@goop.org>
> Reported-by: Leigh Scott <leigh123linux@googlemail.com>
> Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
>
> diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
> index b3b7332..bc18d0e 100644
> --- a/arch/x86/include/asm/cmpxchg.h
> +++ b/arch/x86/include/asm/cmpxchg.h
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


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

* [tip:x86/urgent] x86: Use correct byte-sized register constraint in __xchg_op()
  2012-04-02 23:15 [PATCH] Use correct byte-sized register constraint in __xchg_op() Jeremy Fitzhardinge
  2012-04-04  0:37 ` Josh Boyer
  2012-04-06  7:46 ` Jeremy Fitzhardinge
@ 2012-04-06 16:52 ` tip-bot for Jeremy Fitzhardinge
  2012-04-06 16:53 ` [tip:x86/urgent] x86: Use correct byte-sized register constraint in __add() tip-bot for H. Peter Anvin
  3 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Jeremy Fitzhardinge @ 2012-04-06 16:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, jeremy, hpa, mingo, leigh123linux, treitmayr, tglx

Commit-ID:  2ca052a3710fac208eee690faefdeb8bbd4586a1
Gitweb:     http://git.kernel.org/tip/2ca052a3710fac208eee690faefdeb8bbd4586a1
Author:     Jeremy Fitzhardinge <jeremy@goop.org>
AuthorDate: Mon, 2 Apr 2012 16:15:33 -0700
Committer:  H. Peter Anvin <hpa@zytor.com>
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.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Link: http://lkml.kernel.org/r/4F7A3315.501@goop.org
Reported-by: Leigh Scott <leigh123linux@googlemail.com>
Tested-by: Thomas Reitmayr <treitmayr@devbase.at>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: <stable@vger.kernel.org> v3.3
---
 arch/x86/include/asm/cmpxchg.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index b3b7332..bc18d0e 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -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:					\

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

* [tip:x86/urgent] x86: Use correct byte-sized register constraint in __add()
  2012-04-02 23:15 [PATCH] Use correct byte-sized register constraint in __xchg_op() Jeremy Fitzhardinge
                   ` (2 preceding siblings ...)
  2012-04-06 16:52 ` [tip:x86/urgent] x86: " tip-bot for Jeremy Fitzhardinge
@ 2012-04-06 16:53 ` tip-bot for H. Peter Anvin
  3 siblings, 0 replies; 7+ messages in thread
From: tip-bot for H. Peter Anvin @ 2012-04-06 16:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jeremy, linux-kernel, hpa, mingo, leigh123linux, treitmayr, tglx

Commit-ID:  8c91c5325e107ec17e40a59a47c6517387d64eb7
Gitweb:     http://git.kernel.org/tip/8c91c5325e107ec17e40a59a47c6517387d64eb7
Author:     H. Peter Anvin <hpa@zytor.com>
AuthorDate: Fri, 6 Apr 2012 09:30:57 -0700
Committer:  H. Peter Anvin <hpa@zytor.com>
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.

Link: http://lkml.kernel.org/r/4F7A3315.501@goop.org
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Leigh Scott <leigh123linux@googlemail.com>
Cc: Thomas Reitmayr <treitmayr@devbase.at>
Cc: <stable@vger.kernel.org> v3.3
---
 arch/x86/include/asm/cmpxchg.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index bc18d0e..99480e5 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -173,7 +173,7 @@ extern void __add_wrong_size(void)
 		switch (sizeof(*(ptr))) {				\
 		case __X86_CASE_B:					\
 			asm volatile (lock "addb %b1, %0\n"		\
-				      : "+m" (*(ptr)) : "ri" (inc)	\
+				      : "+m" (*(ptr)) : "qi" (inc)	\
 				      : "memory", "cc");		\
 			break;						\
 		case __X86_CASE_W:					\

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

end of thread, other threads:[~2012-04-06 16:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 23:15 [PATCH] Use correct byte-sized register constraint in __xchg_op() Jeremy Fitzhardinge
2012-04-04  0:37 ` Josh Boyer
2012-04-05 20:27   ` Josh Boyer
2012-04-05 21:16     ` Thomas Reitmayr
2012-04-06  7:46 ` Jeremy Fitzhardinge
2012-04-06 16:52 ` [tip:x86/urgent] x86: " tip-bot for Jeremy Fitzhardinge
2012-04-06 16:53 ` [tip:x86/urgent] x86: Use correct byte-sized register constraint in __add() tip-bot for H. Peter Anvin

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).