x86: crypto: fix building crc32c with clang ias
Subsystems (2)
PATCH 1/1 x86: crypto: fix building crc32c with clang ias
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.
--- arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/crypto/crc32c-pcl-intel-asm_64.S +1 -1
@@ -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
Signature · 1 line
2.26.2
Quoted 9 lines · Arnd Bergmann
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 <[email protected]>
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
Quoted 20 lines
--- arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/crypto/crc32c-pcl-intel-asm_64.S +1
-1@@ -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 bufpSignature · 1 line
2.26.2
Quoted 12 lines · Nathan Chancellor
Quoted 9 lines · Arnd Bergmann
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 <[email protected]>
Quoted 7 lines
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 <[email protected]>
Was the other one submitted upstream? If yes, let's use that one.
Arnd
Quoted 17 lines · Arnd Bergmann
Quoted 15 lines · Nathan Chancellor
Quoted 9 lines · Arnd Bergmann
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 <[email protected]>We had an identical patch pending from another contributor, see the discussion and result in the issue below.
Quoted 8 lines
Quoted 4 lines
https://github.com/ClangBuiltLinux/linux/issues/1010
Reviewed-by Nathan Chancellor <[email protected]>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
Herbert Xu
maintainerQuoted 4 lines · Arnd Bergmann
The clang integrated assembler complains about movzxw:
arch/x86/crypto/crc32c-pcl-intel-asm_64.S:173:2: error: invalid instruction mnemonic 'movzxw'
Quoted 8 lines
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 <[email protected]>--- arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 9 lines · Herbert Xu
Quoted 7 lines · Arnd Bergmann
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.
Quoted 8 lines
Quoted 5 lines
Fixes 6a8ce1ef3940 ("crypto: crc32c - Optimize CRC32C calculation with PCLMULQDQ instruction")Signed-off-by Arnd Bergmann <[email protected]>--- 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