Skip to content

Commit 44200f2

Browse files
nathanchanceherbertx
authored andcommittedApr 16, 2021
crypto: arm/curve25519 - Move '.fpu' after '.arch'
Debian's clang carries a patch that makes the default FPU mode 'vfp3-d16' instead of 'neon' for 'armv7-a' to avoid generating NEON instructions on hardware that does not support them: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/5a61ca6f21b4ad8c6ac4970e5ea5a7b5b4486d22/debian/patches/clang-arm-default-vfp3-on-armv7a.patch https://bugs.debian.org/841474 https://bugs.debian.org/842142 https://bugs.debian.org/914268 This results in the following build error when clang's integrated assembler is used because the '.arch' directive overrides the '.fpu' directive: arch/arm/crypto/curve25519-core.S:25:2: error: instruction requires: NEON vmov.i32 q0, #1 ^ arch/arm/crypto/curve25519-core.S:26:2: error: instruction requires: NEON vshr.u64 q1, q0, torvalds#7 ^ arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON vshr.u64 q0, q0, torvalds#8 ^ arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON vmov.i32 d4, torvalds#19 ^ Shuffle the order of the '.arch' and '.fpu' directives so that the code builds regardless of the default FPU mode. This has been tested against both clang with and without Debian's patch and GCC. Cc: [email protected] Fixes: d8f1308 ("crypto: arm/curve25519 - wire up NEON implementation") Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118 Reported-by: Arnd Bergmann <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Suggested-by: Jessica Clarke <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 1c4d9d5 commit 44200f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎arch/arm/crypto/curve25519-core.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <linux/linkage.h>
1111

1212
.text
13-
.fpu neon
1413
.arch armv7-a
14+
.fpu neon
1515
.align 4
1616

1717
ENTRY(curve25519_neon)

0 commit comments

Comments
 (0)
Please sign in to comment.