All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers
@ 2016-03-15 13:07 Christophe Leroy
  2016-03-15 17:41 ` Scott Wood
  2016-03-16 10:24 ` [v2] " Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe Leroy @ 2016-03-15 13:07 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, Scott Wood
  Cc: linux-kernel, linuxppc-dev

Some versions of GCC, reportedly before 4.8, fail with
arch/powerpc/mm/8xx_mmu.c:139:2: error: memory input 1 is not directly
addressable

Change the one-element array into a simple variable to avoid this.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Scott Wood <oss@buserror.net>
---
Verified with GCC 4.4.4 and GCC 4.8.3

v2: compilation result is compliant with CPU6 ERRATA
    (using stw/lwz and not stwx/lwzx)

 arch/powerpc/include/asm/reg_8xx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/reg_8xx.h b/arch/powerpc/include/asm/reg_8xx.h
index d41412c..94d01f8 100644
--- a/arch/powerpc/include/asm/reg_8xx.h
+++ b/arch/powerpc/include/asm/reg_8xx.h
@@ -53,7 +53,7 @@
 #ifdef CONFIG_8xx_CPU6
 #define do_mtspr_cpu6(rn, rn_addr, v)	\
 	do {								\
-		int _reg_cpu6 = rn_addr, _tmp_cpu6[1];		\
+		int _reg_cpu6 = rn_addr, _tmp_cpu6;		\
 		asm volatile("stw %0, %1;"				\
 			     "lwz %0, %1;"				\
 			     "mtspr " __stringify(rn) ",%2" :		\
-- 
2.1.0

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

* Re: [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers
  2016-03-15 13:07 [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers Christophe Leroy
@ 2016-03-15 17:41 ` Scott Wood
  2016-03-15 18:12   ` christophe leroy
  2016-03-16 10:24 ` [v2] " Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Scott Wood @ 2016-03-15 17:41 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman
  Cc: linux-kernel, linuxppc-dev

On Tue, 2016-03-15 at 14:07 +0100, Christophe Leroy wrote:
> Some versions of GCC, reportedly before 4.8, fail with
> arch/powerpc/mm/8xx_mmu.c:139:2: error: memory input 1 is not directly
> addressable

"before 4.8" means "< 4.8", not "<= 4.8" -- did you mean "before 4.9"?

> Change the one-element array into a simple variable to avoid this.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Cc: Scott Wood <oss@buserror.net>
> ---
> Verified with GCC 4.4.4 and GCC 4.8.3
> 
> v2: compilation result is compliant with CPU6 ERRATA
>     (using stw/lwz and not stwx/lwzx)
> 
>  arch/powerpc/include/asm/reg_8xx.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/reg_8xx.h
> b/arch/powerpc/include/asm/reg_8xx.h
> index d41412c..94d01f8 100644
> --- a/arch/powerpc/include/asm/reg_8xx.h
> +++ b/arch/powerpc/include/asm/reg_8xx.h
> @@ -53,7 +53,7 @@
>  #ifdef CONFIG_8xx_CPU6
>  #define do_mtspr_cpu6(rn, rn_addr, v)	\
>  	do {								
> \
> -		int _reg_cpu6 = rn_addr, _tmp_cpu6[1];		\
> +		int _reg_cpu6 = rn_addr, _tmp_cpu6;		\
>  		asm volatile("stw %0, %1;"				\
>  			     "lwz %0, %1;"				\
>  			     "mtspr " __stringify(rn) ",%2" :		
> \

I thought I tried this with 4.7.2 without success, but now it seems to be
working...

-Scott

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

* Re: [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers
  2016-03-15 17:41 ` Scott Wood
@ 2016-03-15 18:12   ` christophe leroy
  0 siblings, 0 replies; 4+ messages in thread
From: christophe leroy @ 2016-03-15 18:12 UTC (permalink / raw)
  To: Scott Wood, Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: linux-kernel, linuxppc-dev



Le 15/03/2016 18:41, Scott Wood a écrit :
> On Tue, 2016-03-15 at 14:07 +0100, Christophe Leroy wrote:
>> Some versions of GCC, reportedly before 4.8, fail with
>> arch/powerpc/mm/8xx_mmu.c:139:2: error: memory input 1 is not directly
>> addressable
> "before 4.8" means "< 4.8", not "<= 4.8" -- did you mean "before 4.9"?
I mean it doesn't fail with 4.8.3

Christophe
>
>> Change the one-element array into a simple variable to avoid this.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> Cc: Scott Wood <oss@buserror.net>
>> ---
>> Verified with GCC 4.4.4 and GCC 4.8.3
>>
>> v2: compilation result is compliant with CPU6 ERRATA
>>      (using stw/lwz and not stwx/lwzx)
>>
>>   arch/powerpc/include/asm/reg_8xx.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/include/asm/reg_8xx.h
>> b/arch/powerpc/include/asm/reg_8xx.h
>> index d41412c..94d01f8 100644
>> --- a/arch/powerpc/include/asm/reg_8xx.h
>> +++ b/arch/powerpc/include/asm/reg_8xx.h
>> @@ -53,7 +53,7 @@
>>   #ifdef CONFIG_8xx_CPU6
>>   #define do_mtspr_cpu6(rn, rn_addr, v)	\
>>   	do {								
>> \
>> -		int _reg_cpu6 = rn_addr, _tmp_cpu6[1];		\
>> +		int _reg_cpu6 = rn_addr, _tmp_cpu6;		\
>>   		asm volatile("stw %0, %1;"				\
>>   			     "lwz %0, %1;"				\
>>   			     "mtspr " __stringify(rn) ",%2" :		
>> \
> I thought I tried this with 4.7.2 without success, but now it seems to be
> working...
>
> -Scott
>


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

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

* Re: [v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers
  2016-03-15 13:07 [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers Christophe Leroy
  2016-03-15 17:41 ` Scott Wood
@ 2016-03-16 10:24 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2016-03-16 10:24 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras, Scott Wood
  Cc: linuxppc-dev, linux-kernel

On Tue, 2016-15-03 at 13:07:49 UTC, Christophe Leroy wrote:
> Some versions of GCC, reportedly before 4.8, fail with
> arch/powerpc/mm/8xx_mmu.c:139:2: error: memory input 1 is not directly
> addressable
> 
> Change the one-element array into a simple variable to avoid this.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Cc: Scott Wood <oss@buserror.net>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2e098dcee6208a690f73e11feb

cheers

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

end of thread, other threads:[~2016-03-16 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-15 13:07 [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers Christophe Leroy
2016-03-15 17:41 ` Scott Wood
2016-03-15 18:12   ` christophe leroy
2016-03-16 10:24 ` [v2] " Michael Ellerman

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.