All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-18 16:04 ` James Hogan
  0 siblings, 0 replies; 9+ messages in thread
From: James Hogan @ 2016-05-18 16:04 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: James Hogan, linux-mips

The versions of the __write_{32,64}bit_gc0_register() macros for when
there is no virt support in the assembler use the "J" inline asm
constraint to allow integer zero, but this needs to be accompanied by
the "z" formatting string so that it turns into $0. Fix both macros to
do this.

Fixes: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils <2.24")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/include/asm/mipsregs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 25d01577d0b5..18bb6f9f0d16 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -1770,7 +1770,7 @@ do {									\
 	__asm__ __volatile__(						\
 		".set\tpush\n\t"					\
 		".set\tnoat\n\t"					\
-		"move\t$1, %0\n\t"					\
+		"move\t$1, %z0\n\t"					\
 		"# mtgc0\t$1, $%1, %2\n\t"				\
 		".word\t(0x40610200 | %1 << 11 | %2)\n\t"		\
 		".set\tpop"						\
@@ -1783,7 +1783,7 @@ do {									\
 	__asm__ __volatile__(						\
 		".set\tpush\n\t"					\
 		".set\tnoat\n\t"					\
-		"move\t$1, %0\n\t"					\
+		"move\t$1, %z0\n\t"					\
 		"# dmtgc0\t$1, $%1, %2\n\t"				\
 		".word\t(0x40610300 | %1 << 11 | %2)\n\t"		\
 		".set\tpop"						\
-- 
2.4.10

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

* [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-18 16:04 ` James Hogan
  0 siblings, 0 replies; 9+ messages in thread
From: James Hogan @ 2016-05-18 16:04 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: James Hogan, linux-mips

The versions of the __write_{32,64}bit_gc0_register() macros for when
there is no virt support in the assembler use the "J" inline asm
constraint to allow integer zero, but this needs to be accompanied by
the "z" formatting string so that it turns into $0. Fix both macros to
do this.

Fixes: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils <2.24")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
---
 arch/mips/include/asm/mipsregs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 25d01577d0b5..18bb6f9f0d16 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -1770,7 +1770,7 @@ do {									\
 	__asm__ __volatile__(						\
 		".set\tpush\n\t"					\
 		".set\tnoat\n\t"					\
-		"move\t$1, %0\n\t"					\
+		"move\t$1, %z0\n\t"					\
 		"# mtgc0\t$1, $%1, %2\n\t"				\
 		".word\t(0x40610200 | %1 << 11 | %2)\n\t"		\
 		".set\tpop"						\
@@ -1783,7 +1783,7 @@ do {									\
 	__asm__ __volatile__(						\
 		".set\tpush\n\t"					\
 		".set\tnoat\n\t"					\
-		"move\t$1, %0\n\t"					\
+		"move\t$1, %z0\n\t"					\
 		"# dmtgc0\t$1, $%1, %2\n\t"				\
 		".word\t(0x40610300 | %1 << 11 | %2)\n\t"		\
 		".set\tpop"						\
-- 
2.4.10

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-20  8:01   ` Maciej W. Rozycki
  0 siblings, 0 replies; 9+ messages in thread
From: Maciej W. Rozycki @ 2016-05-20  8:01 UTC (permalink / raw)
  To: James Hogan; +Cc: Ralf Baechle, linux-mips

On Wed, 18 May 2016, James Hogan wrote:

> The versions of the __write_{32,64}bit_gc0_register() macros for when
> there is no virt support in the assembler use the "J" inline asm
> constraint to allow integer zero, but this needs to be accompanied by
> the "z" formatting string so that it turns into $0. Fix both macros to
> do this.

 NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
There are a few generic operand codes as well, most notably `a' to print 
an address, matching the `p' constraint.  I think it would be good to have 
this all documented in the GCC manual sometime.

> Fixes: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils <2.24")
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> ---

Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>

  Maciej

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-20  8:01   ` Maciej W. Rozycki
  0 siblings, 0 replies; 9+ messages in thread
From: Maciej W. Rozycki @ 2016-05-20  8:01 UTC (permalink / raw)
  To: James Hogan; +Cc: Ralf Baechle, linux-mips

On Wed, 18 May 2016, James Hogan wrote:

> The versions of the __write_{32,64}bit_gc0_register() macros for when
> there is no virt support in the assembler use the "J" inline asm
> constraint to allow integer zero, but this needs to be accompanied by
> the "z" formatting string so that it turns into $0. Fix both macros to
> do this.

 NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
There are a few generic operand codes as well, most notably `a' to print 
an address, matching the `p' constraint.  I think it would be good to have 
this all documented in the GCC manual sometime.

> Fixes: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils <2.24")
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> ---

Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>

  Maciej

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-20  8:13     ` James Hogan
  0 siblings, 0 replies; 9+ messages in thread
From: James Hogan @ 2016-05-20  8:13 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Ralf Baechle, linux-mips

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

On Fri, May 20, 2016 at 09:01:33AM +0100, Maciej W. Rozycki wrote:
> On Wed, 18 May 2016, James Hogan wrote:
> 
> > The versions of the __write_{32,64}bit_gc0_register() macros for when
> > there is no virt support in the assembler use the "J" inline asm
> > constraint to allow integer zero, but this needs to be accompanied by
> > the "z" formatting string so that it turns into $0. Fix both macros to
> > do this.
> 
>  NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
> MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
> There are a few generic operand codes as well, most notably `a' to print 
> an address, matching the `p' constraint.  I think it would be good to have 
> this all documented in the GCC manual sometime.

Thanks Maciej! To be honest I pretty much guessed at what they were
called. Good to see 'z' does do what I thought. I couldn't find any
documentation online for the MIPS specific operand codes, so having them
documented with GCC would be an excellent idea!

> 
> > Fixes: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils <2.24")
> > Signed-off-by: James Hogan <james.hogan@imgtec.com>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > Cc: linux-mips@linux-mips.org
> > ---
> 
> Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>

Thanks!

James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-20  8:13     ` James Hogan
  0 siblings, 0 replies; 9+ messages in thread
From: James Hogan @ 2016-05-20  8:13 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Ralf Baechle, linux-mips

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

On Fri, May 20, 2016 at 09:01:33AM +0100, Maciej W. Rozycki wrote:
> On Wed, 18 May 2016, James Hogan wrote:
> 
> > The versions of the __write_{32,64}bit_gc0_register() macros for when
> > there is no virt support in the assembler use the "J" inline asm
> > constraint to allow integer zero, but this needs to be accompanied by
> > the "z" formatting string so that it turns into $0. Fix both macros to
> > do this.
> 
>  NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
> MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
> There are a few generic operand codes as well, most notably `a' to print 
> an address, matching the `p' constraint.  I think it would be good to have 
> this all documented in the GCC manual sometime.

Thanks Maciej! To be honest I pretty much guessed at what they were
called. Good to see 'z' does do what I thought. I couldn't find any
documentation online for the MIPS specific operand codes, so having them
documented with GCC would be an excellent idea!

> 
> > Fixes: bad50d79255a ("MIPS: Fix VZ probe gas errors with binutils <2.24")
> > Signed-off-by: James Hogan <james.hogan@imgtec.com>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > Cc: linux-mips@linux-mips.org
> > ---
> 
> Reviewed-by: Maciej W. Rozycki <macro@imgtec.com>

Thanks!

James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-20  8:31       ` Maciej W. Rozycki
  0 siblings, 0 replies; 9+ messages in thread
From: Maciej W. Rozycki @ 2016-05-20  8:31 UTC (permalink / raw)
  To: James Hogan; +Cc: Ralf Baechle, linux-mips

On Fri, 20 May 2016, James Hogan wrote:

> >  NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
> > MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
> > There are a few generic operand codes as well, most notably `a' to print 
> > an address, matching the `p' constraint.  I think it would be good to have 
> > this all documented in the GCC manual sometime.
> 
> Thanks Maciej! To be honest I pretty much guessed at what they were
> called. Good to see 'z' does do what I thought. I couldn't find any
> documentation online for the MIPS specific operand codes, so having them
> documented with GCC would be an excellent idea!

 Yeah, this stuff is a bit obscure (the other one being %-sequences for 
the specs) and I always find myself chasing sources when I need any of 
this.  Frankly by now I have already remembered roughly where to look for.

 Once tracked down however the description within sources is pretty good 
actually, so please refer there for the time being.

  Maciej

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
@ 2016-05-20  8:31       ` Maciej W. Rozycki
  0 siblings, 0 replies; 9+ messages in thread
From: Maciej W. Rozycki @ 2016-05-20  8:31 UTC (permalink / raw)
  To: James Hogan; +Cc: Ralf Baechle, linux-mips

On Fri, 20 May 2016, James Hogan wrote:

> >  NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
> > MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
> > There are a few generic operand codes as well, most notably `a' to print 
> > an address, matching the `p' constraint.  I think it would be good to have 
> > this all documented in the GCC manual sometime.
> 
> Thanks Maciej! To be honest I pretty much guessed at what they were
> called. Good to see 'z' does do what I thought. I couldn't find any
> documentation online for the MIPS specific operand codes, so having them
> documented with GCC would be an excellent idea!

 Yeah, this stuff is a bit obscure (the other one being %-sequences for 
the specs) and I always find myself chasing sources when I need any of 
this.  Frankly by now I have already remembered roughly where to look for.

 Once tracked down however the description within sources is pretty good 
actually, so please refer there for the time being.

  Maciej

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

* Re: [PATCH] MIPS: Fix write_gc0_* macros when writing zero
  2016-05-20  8:31       ` Maciej W. Rozycki
  (?)
@ 2016-05-20 13:13       ` Ralf Baechle
  -1 siblings, 0 replies; 9+ messages in thread
From: Ralf Baechle @ 2016-05-20 13:13 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: James Hogan, linux-mips

On Fri, May 20, 2016 at 09:31:15AM +0100, Maciej W. Rozycki wrote:

> On Fri, 20 May 2016, James Hogan wrote:
> 
> > >  NB `z' here is an "operand code" in GCC-speak.  There's a list of the 
> > > MIPS-specific ones in gcc/config/mips/mips.c above `mips_print_operand'.  
> > > There are a few generic operand codes as well, most notably `a' to print 
> > > an address, matching the `p' constraint.  I think it would be good to have 
> > > this all documented in the GCC manual sometime.
> > 
> > Thanks Maciej! To be honest I pretty much guessed at what they were
> > called. Good to see 'z' does do what I thought. I couldn't find any
> > documentation online for the MIPS specific operand codes, so having them
> > documented with GCC would be an excellent idea!
> 
>  Yeah, this stuff is a bit obscure (the other one being %-sequences for 
> the specs) and I always find myself chasing sources when I need any of 
> this.  Frankly by now I have already remembered roughly where to look for.
> 
>  Once tracked down however the description within sources is pretty good 
> actually, so please refer there for the time being.

Material for a wiki page?

  Ralf

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

end of thread, other threads:[~2016-05-20 13:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-18 16:04 [PATCH] MIPS: Fix write_gc0_* macros when writing zero James Hogan
2016-05-18 16:04 ` James Hogan
2016-05-20  8:01 ` Maciej W. Rozycki
2016-05-20  8:01   ` Maciej W. Rozycki
2016-05-20  8:13   ` James Hogan
2016-05-20  8:13     ` James Hogan
2016-05-20  8:31     ` Maciej W. Rozycki
2016-05-20  8:31       ` Maciej W. Rozycki
2016-05-20 13:13       ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.