linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/mpi: Fix building for powerpc with clang
@ 2020-04-13 19:50 Nathan Chancellor
  2020-04-14  7:36 ` Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nathan Chancellor @ 2020-04-13 19:50 UTC (permalink / raw)
  To: Herbert Xu, Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, linux-crypto,
	linuxppc-dev, linux-kernel, clang-built-linux, Nathan Chancellor,
	kbuild test robot

0day reports over and over on an powerpc randconfig with clang:

lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
inline asm context requiring an l-value: remove the cast or build with
-fheinous-gnu-extensions

Remove the superfluous casts, which have been done previously for x86
and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
x86").

Reported-by: kbuild test robot <lkp@intel.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/991
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

Herbet seems to take lib/mpi patches but there does not seem to be a
formal maintainer so Michael could take it since it is just a powerpc
thing.

 lib/mpi/longlong.h | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index 2dceaca27489..891e1c3549c4 100644
--- a/lib/mpi/longlong.h
+++ b/lib/mpi/longlong.h
@@ -722,22 +722,22 @@ do {									\
 do { \
 	if (__builtin_constant_p(bh) && (bh) == 0) \
 		__asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "%r" ((USItype)(ah)), \
 		"%r" ((USItype)(al)), \
 		"rI" ((USItype)(bl))); \
 	else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
 		__asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "%r" ((USItype)(ah)), \
 		"%r" ((USItype)(al)), \
 		"rI" ((USItype)(bl))); \
 	else \
 		__asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "%r" ((USItype)(ah)), \
 		"r" ((USItype)(bh)), \
 		"%r" ((USItype)(al)), \
@@ -747,36 +747,36 @@ do { \
 do { \
 	if (__builtin_constant_p(ah) && (ah) == 0) \
 		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "r" ((USItype)(bh)), \
 		"rI" ((USItype)(al)), \
 		"r" ((USItype)(bl))); \
 	else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \
 		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "r" ((USItype)(bh)), \
 		"rI" ((USItype)(al)), \
 		"r" ((USItype)(bl))); \
 	else if (__builtin_constant_p(bh) && (bh) == 0) \
 		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "r" ((USItype)(ah)), \
 		"rI" ((USItype)(al)), \
 		"r" ((USItype)(bl))); \
 	else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
 		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "r" ((USItype)(ah)), \
 		"rI" ((USItype)(al)), \
 		"r" ((USItype)(bl))); \
 	else \
 		__asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
-		: "=r" ((USItype)(sh)), \
-		"=&r" ((USItype)(sl)) \
+		: "=r" (sh), \
+		"=&r" (sl) \
 		: "r" ((USItype)(ah)), \
 		"r" ((USItype)(bh)), \
 		"rI" ((USItype)(al)), \
@@ -787,7 +787,7 @@ do { \
 do { \
 	USItype __m0 = (m0), __m1 = (m1); \
 	__asm__ ("mulhwu %0,%1,%2" \
-	: "=r" ((USItype) ph) \
+	: "=r" (ph) \
 	: "%r" (__m0), \
 	"r" (__m1)); \
 	(pl) = __m0 * __m1; \

base-commit: 8f3d9f354286745c751374f5f1fcafee6b3f3136
-- 
2.26.0


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

* Re: [PATCH] lib/mpi: Fix building for powerpc with clang
  2020-04-13 19:50 [PATCH] lib/mpi: Fix building for powerpc with clang Nathan Chancellor
@ 2020-04-14  7:36 ` Michael Ellerman
  2020-04-14 13:57 ` Herbert Xu
  2020-04-25 23:51 ` Michael Ellerman
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2020-04-14  7:36 UTC (permalink / raw)
  To: Nathan Chancellor, Herbert Xu
  Cc: Benjamin Herrenschmidt, Paul Mackerras, linux-crypto,
	linuxppc-dev, linux-kernel, clang-built-linux, Nathan Chancellor,
	kbuild test robot

Nathan Chancellor <natechancellor@gmail.com> writes:
> 0day reports over and over on an powerpc randconfig with clang:
>
> lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
> inline asm context requiring an l-value: remove the cast or build with
> -fheinous-gnu-extensions
>
> Remove the superfluous casts, which have been done previously for x86
> and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
> commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
> x86").
>
> Reported-by: kbuild test robot <lkp@intel.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/991
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>
> Herbet seems to take lib/mpi patches but there does not seem to be a
> formal maintainer so Michael could take it since it is just a powerpc
> thing.

Oh you mean it's inside:

#if (defined(_ARCH_PPC) || defined(_IBMR2)) && W_TYPE_SIZE == 32


I don't mind taking it with Herbet's ack, or he could just merge it.

cheers


>
>  lib/mpi/longlong.h | 34 +++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
> index 2dceaca27489..891e1c3549c4 100644
> --- a/lib/mpi/longlong.h
> +++ b/lib/mpi/longlong.h
> @@ -722,22 +722,22 @@ do {									\
>  do { \
>  	if (__builtin_constant_p(bh) && (bh) == 0) \
>  		__asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "%r" ((USItype)(ah)), \
>  		"%r" ((USItype)(al)), \
>  		"rI" ((USItype)(bl))); \
>  	else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
>  		__asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "%r" ((USItype)(ah)), \
>  		"%r" ((USItype)(al)), \
>  		"rI" ((USItype)(bl))); \
>  	else \
>  		__asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "%r" ((USItype)(ah)), \
>  		"r" ((USItype)(bh)), \
>  		"%r" ((USItype)(al)), \
> @@ -747,36 +747,36 @@ do { \
>  do { \
>  	if (__builtin_constant_p(ah) && (ah) == 0) \
>  		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "r" ((USItype)(bh)), \
>  		"rI" ((USItype)(al)), \
>  		"r" ((USItype)(bl))); \
>  	else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \
>  		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "r" ((USItype)(bh)), \
>  		"rI" ((USItype)(al)), \
>  		"r" ((USItype)(bl))); \
>  	else if (__builtin_constant_p(bh) && (bh) == 0) \
>  		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "r" ((USItype)(ah)), \
>  		"rI" ((USItype)(al)), \
>  		"r" ((USItype)(bl))); \
>  	else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
>  		__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "r" ((USItype)(ah)), \
>  		"rI" ((USItype)(al)), \
>  		"r" ((USItype)(bl))); \
>  	else \
>  		__asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
> -		: "=r" ((USItype)(sh)), \
> -		"=&r" ((USItype)(sl)) \
> +		: "=r" (sh), \
> +		"=&r" (sl) \
>  		: "r" ((USItype)(ah)), \
>  		"r" ((USItype)(bh)), \
>  		"rI" ((USItype)(al)), \
> @@ -787,7 +787,7 @@ do { \
>  do { \
>  	USItype __m0 = (m0), __m1 = (m1); \
>  	__asm__ ("mulhwu %0,%1,%2" \
> -	: "=r" ((USItype) ph) \
> +	: "=r" (ph) \
>  	: "%r" (__m0), \
>  	"r" (__m1)); \
>  	(pl) = __m0 * __m1; \
>
> base-commit: 8f3d9f354286745c751374f5f1fcafee6b3f3136
> -- 
> 2.26.0

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

* Re: [PATCH] lib/mpi: Fix building for powerpc with clang
  2020-04-13 19:50 [PATCH] lib/mpi: Fix building for powerpc with clang Nathan Chancellor
  2020-04-14  7:36 ` Michael Ellerman
@ 2020-04-14 13:57 ` Herbert Xu
  2020-04-23 16:36   ` Nathan Chancellor
  2020-04-25 23:51 ` Michael Ellerman
  2 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2020-04-14 13:57 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	linux-crypto, linuxppc-dev, linux-kernel, clang-built-linux,
	kbuild test robot

On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote:
> 0day reports over and over on an powerpc randconfig with clang:
> 
> lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
> inline asm context requiring an l-value: remove the cast or build with
> -fheinous-gnu-extensions
> 
> Remove the superfluous casts, which have been done previously for x86
> and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
> commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
> x86").
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/991
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] lib/mpi: Fix building for powerpc with clang
  2020-04-14 13:57 ` Herbert Xu
@ 2020-04-23 16:36   ` Nathan Chancellor
  2020-04-24  3:23     ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2020-04-23 16:36 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	linux-crypto, linuxppc-dev, linux-kernel, clang-built-linux,
	kbuild test robot

On Tue, Apr 14, 2020 at 11:57:31PM +1000, Herbert Xu wrote:
> On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote:
> > 0day reports over and over on an powerpc randconfig with clang:
> > 
> > lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
> > inline asm context requiring an l-value: remove the cast or build with
> > -fheinous-gnu-extensions
> > 
> > Remove the superfluous casts, which have been done previously for x86
> > and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
> > commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
> > x86").
> > 
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Link: https://github.com/ClangBuiltLinux/linux/issues/991
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> 
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Might be better for you to take this instead. 0day just tripped over
this again.

Cheers,
Nathan

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

* Re: [PATCH] lib/mpi: Fix building for powerpc with clang
  2020-04-23 16:36   ` Nathan Chancellor
@ 2020-04-24  3:23     ` Michael Ellerman
  2020-04-24  8:13       ` Nathan Chancellor
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2020-04-24  3:23 UTC (permalink / raw)
  To: Nathan Chancellor, Herbert Xu
  Cc: Benjamin Herrenschmidt, Paul Mackerras, linux-crypto,
	linuxppc-dev, linux-kernel, clang-built-linux, kbuild test robot

Nathan Chancellor <natechancellor@gmail.com> writes:
> On Tue, Apr 14, 2020 at 11:57:31PM +1000, Herbert Xu wrote:
>> On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote:
>> > 0day reports over and over on an powerpc randconfig with clang:
>> > 
>> > lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
>> > inline asm context requiring an l-value: remove the cast or build with
>> > -fheinous-gnu-extensions
>> > 
>> > Remove the superfluous casts, which have been done previously for x86
>> > and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
>> > commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
>> > x86").
>> > 
>> > Reported-by: kbuild test robot <lkp@intel.com>
>> > Link: https://github.com/ClangBuiltLinux/linux/issues/991
>> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
>> 
>> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
>> -- 
>> Email: Herbert Xu <herbert@gondor.apana.org.au>
>> Home Page: http://gondor.apana.org.au/~herbert/
>> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
> Might be better for you to take this instead. 0day just tripped over
> this again.

Sorry I missed the ack. Will pick it up today.

cheers

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

* Re: [PATCH] lib/mpi: Fix building for powerpc with clang
  2020-04-24  3:23     ` Michael Ellerman
@ 2020-04-24  8:13       ` Nathan Chancellor
  0 siblings, 0 replies; 7+ messages in thread
From: Nathan Chancellor @ 2020-04-24  8:13 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Herbert Xu, Benjamin Herrenschmidt, Paul Mackerras, linux-crypto,
	linuxppc-dev, linux-kernel, clang-built-linux, kbuild test robot

On Fri, Apr 24, 2020 at 01:23:37PM +1000, Michael Ellerman wrote:
> Nathan Chancellor <natechancellor@gmail.com> writes:
> > On Tue, Apr 14, 2020 at 11:57:31PM +1000, Herbert Xu wrote:
> >> On Mon, Apr 13, 2020 at 12:50:42PM -0700, Nathan Chancellor wrote:
> >> > 0day reports over and over on an powerpc randconfig with clang:
> >> > 
> >> > lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
> >> > inline asm context requiring an l-value: remove the cast or build with
> >> > -fheinous-gnu-extensions
> >> > 
> >> > Remove the superfluous casts, which have been done previously for x86
> >> > and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
> >> > commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
> >> > x86").
> >> > 
> >> > Reported-by: kbuild test robot <lkp@intel.com>
> >> > Link: https://github.com/ClangBuiltLinux/linux/issues/991
> >> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> >> 
> >> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
> >> -- 
> >> Email: Herbert Xu <herbert@gondor.apana.org.au>
> >> Home Page: http://gondor.apana.org.au/~herbert/
> >> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> >
> > Might be better for you to take this instead. 0day just tripped over
> > this again.
> 
> Sorry I missed the ack. Will pick it up today.
> 
> cheers

Thank you!

Cheers,
Nathan

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

* Re: [PATCH] lib/mpi: Fix building for powerpc with clang
  2020-04-13 19:50 [PATCH] lib/mpi: Fix building for powerpc with clang Nathan Chancellor
  2020-04-14  7:36 ` Michael Ellerman
  2020-04-14 13:57 ` Herbert Xu
@ 2020-04-25 23:51 ` Michael Ellerman
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2020-04-25 23:51 UTC (permalink / raw)
  To: Nathan Chancellor, Herbert Xu
  Cc: kbuild test robot, linux-kernel, clang-built-linux,
	Paul Mackerras, linux-crypto, Nathan Chancellor, linuxppc-dev

On Mon, 2020-04-13 at 19:50:42 UTC, Nathan Chancellor wrote:
> 0day reports over and over on an powerpc randconfig with clang:
> 
> lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a
> inline asm context requiring an l-value: remove the cast or build with
> -fheinous-gnu-extensions
> 
> Remove the superfluous casts, which have been done previously for x86
> and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and
> commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit
> x86").
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/991
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/5990cdee689c6885b27c6d969a3d58b09002b0bc

cheers

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

end of thread, other threads:[~2020-04-25 23:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 19:50 [PATCH] lib/mpi: Fix building for powerpc with clang Nathan Chancellor
2020-04-14  7:36 ` Michael Ellerman
2020-04-14 13:57 ` Herbert Xu
2020-04-23 16:36   ` Nathan Chancellor
2020-04-24  3:23     ` Michael Ellerman
2020-04-24  8:13       ` Nathan Chancellor
2020-04-25 23:51 ` Michael Ellerman

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