All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: crypto: fix building crc32c with clang ias
@ 2020-05-27 14:17 Arnd Bergmann
  2020-05-27 16:42 ` Nathan Chancellor
  2020-07-23  7:56 ` Herbert Xu
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2020-05-27 14:17 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, Tim Chen
  Cc: Arnd Bergmann, H. Peter Anvin, Boris Ostrovsky,
	Rafael J. Wysocki, Josh Poimboeuf, Jiri Slaby, Peter Zijlstra,
	linux-crypto, linux-kernel, clang-built-linux

The clang integrated assembler complains about movzxw:

arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'

It seems that movzwq is the mnemonic that it expects instead,
and this is what objdump prints when disassembling the file.

Fixes: 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
index 8501ec4532f4..442599cbe796 100644
--- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
+++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
@@ -170,7 +170,7 @@ continue_block:
 
 	## branch into array
 	lea	jump_table(%rip), %bufp
-	movzxw  (%bufp, %rax, 2), len
+	movzwq  (%bufp, %rax, 2), len
 	lea	crc_array(%rip), %bufp
 	lea     (%bufp, len, 1), %bufp
 	JMP_NOSPEC bufp
-- 
2.26.2


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

* Re: [PATCH] x86: crypto: fix building crc32c with clang ias
  2020-05-27 14:17 [PATCH] x86: crypto: fix building crc32c with clang ias Arnd Bergmann
@ 2020-05-27 16:42 ` Nathan Chancellor
  2020-05-27 18:24   ` Arnd Bergmann
  2020-07-23  7:56 ` Herbert Xu
  1 sibling, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2020-05-27 16:42 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Herbert Xu, David S. Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, Tim Chen, H. Peter Anvin, Boris Ostrovsky,
	Rafael J. Wysocki, Josh Poimboeuf, Jiri Slaby, Peter Zijlstra,
	linux-crypto, linux-kernel, clang-built-linux

On Wed, May 27, 2020 at 04:17:40PM +0200, Arnd Bergmann wrote:
> The clang integrated assembler complains about movzxw:
> 
> arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'
> 
> It seems that movzwq is the mnemonic that it expects instead,
> and this is what objdump prints when disassembling the file.
> 
> Fixes: 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

We had an identical patch pending from another contributor, see the
discussion and result in the issue below.

https://github.com/ClangBuiltLinux/linux/issues/1010

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

> ---
>  arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
> index 8501ec4532f4..442599cbe796 100644
> --- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
> +++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
> @@ -170,7 +170,7 @@ continue_block:
>  
>  	## branch into array
>  	lea	jump_table(%rip), %bufp
> -	movzxw  (%bufp, %rax, 2), len
> +	movzwq  (%bufp, %rax, 2), len
>  	lea	crc_array(%rip), %bufp
>  	lea     (%bufp, len, 1), %bufp
>  	JMP_NOSPEC bufp
> -- 
> 2.26.2
> 

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

* Re: [PATCH] x86: crypto: fix building crc32c with clang ias
  2020-05-27 16:42 ` Nathan Chancellor
@ 2020-05-27 18:24   ` Arnd Bergmann
  2020-05-27 19:34     ` Nathan Chancellor
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2020-05-27 18:24 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Herbert Xu, David S. Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, Tim Chen,
	H. Peter Anvin, Boris Ostrovsky, Rafael J. Wysocki,
	Josh Poimboeuf, Jiri Slaby, Peter Zijlstra,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, linux-kernel,
	clang-built-linux

On Wed, May 27, 2020 at 6:42 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Wed, May 27, 2020 at 04:17:40PM +0200, Arnd Bergmann wrote:
> > The clang integrated assembler complains about movzxw:
> >
> > arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'
> >
> > It seems that movzwq is the mnemonic that it expects instead,
> > and this is what objdump prints when disassembling the file.
> >
> > Fixes: 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> We had an identical patch pending from another contributor, see the
> discussion and result in the issue below.
>
> https://github.com/ClangBuiltLinux/linux/issues/1010
>
> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
>

Was the other one submitted upstream? If yes, let's use that one.

     Arnd

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

* Re: [PATCH] x86: crypto: fix building crc32c with clang ias
  2020-05-27 18:24   ` Arnd Bergmann
@ 2020-05-27 19:34     ` Nathan Chancellor
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Chancellor @ 2020-05-27 19:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Herbert Xu, David S. Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, the arch/x86 maintainers, Tim Chen,
	H. Peter Anvin, Boris Ostrovsky, Rafael J. Wysocki,
	Josh Poimboeuf, Jiri Slaby, Peter Zijlstra,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, linux-kernel,
	clang-built-linux, Diab Neiroukh

On Wed, May 27, 2020 at 08:24:35PM +0200, Arnd Bergmann wrote:
> On Wed, May 27, 2020 at 6:42 PM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > On Wed, May 27, 2020 at 04:17:40PM +0200, Arnd Bergmann wrote:
> > > The clang integrated assembler complains about movzxw:
> > >
> > > arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'
> > >
> > > It seems that movzwq is the mnemonic that it expects instead,
> > > and this is what objdump prints when disassembling the file.
> > >
> > > Fixes: 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > We had an identical patch pending from another contributor, see the
> > discussion and result in the issue below.
> >
> > https://github.com/ClangBuiltLinux/linux/issues/1010
> >
> > Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
> >
> 
> Was the other one submitted upstream? If yes, let's use that one.
> 
>      Arnd

No, at least not that I saw. I've added Diab to CC now though to
confirm.

Cheers,
Nathan

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

* Re: [PATCH] x86: crypto: fix building crc32c with clang ias
  2020-05-27 14:17 [PATCH] x86: crypto: fix building crc32c with clang ias Arnd Bergmann
  2020-05-27 16:42 ` Nathan Chancellor
@ 2020-07-23  7:56 ` Herbert Xu
  2020-07-23  8:18   ` Sedat Dilek
  1 sibling, 1 reply; 6+ messages in thread
From: Herbert Xu @ 2020-07-23  7:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David S. Miller, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	x86, Tim Chen, H. Peter Anvin, Boris Ostrovsky,
	Rafael J. Wysocki, Josh Poimboeuf, Jiri Slaby, Peter Zijlstra,
	linux-crypto, linux-kernel, clang-built-linux

On Wed, May 27, 2020 at 04:17:40PM +0200, Arnd Bergmann wrote:
> The clang integrated assembler complains about movzxw:
> 
> arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'
> 
> It seems that movzwq is the mnemonic that it expects instead,
> and this is what objdump prints when disassembling the file.
> 
> Fixes: 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
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] 6+ messages in thread

* Re: [PATCH] x86: crypto: fix building crc32c with clang ias
  2020-07-23  7:56 ` Herbert Xu
@ 2020-07-23  8:18   ` Sedat Dilek
  0 siblings, 0 replies; 6+ messages in thread
From: Sedat Dilek @ 2020-07-23  8:18 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Arnd Bergmann, David S. Miller, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, Tim Chen, H. Peter Anvin, Boris Ostrovsky,
	Rafael J. Wysocki, Josh Poimboeuf, Jiri Slaby, Peter Zijlstra,
	linux-crypto, linux-kernel, Clang-Built-Linux ML

On Thu, Jul 23, 2020 at 9:57 AM Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Wed, May 27, 2020 at 04:17:40PM +0200, Arnd Bergmann wrote:
> > The clang integrated assembler complains about movzxw:
> >
> > arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'
> >
> > It seems that movzwq is the mnemonic that it expects instead,
> > and this is what objdump prints when disassembling the file.
> >
> > Fixes: 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Patch applied.  Thanks.
>

Thanks you very much.

Now we have all x86/crypto patches to be able to use Clang's
Integrated Assembler (IAS) and build with `make LLVM_IAS=1`.

- Sedat -

[1] https://github.com/ClangBuiltLinux/linux/issues/1049#issuecomment-662609378

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

end of thread, other threads:[~2020-07-23  8:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 14:17 [PATCH] x86: crypto: fix building crc32c with clang ias Arnd Bergmann
2020-05-27 16:42 ` Nathan Chancellor
2020-05-27 18:24   ` Arnd Bergmann
2020-05-27 19:34     ` Nathan Chancellor
2020-07-23  7:56 ` Herbert Xu
2020-07-23  8:18   ` Sedat Dilek

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.