From 97df8918f17323fb3f8c653243e637824b5e353a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 22 Sep 2018 07:12:39 +0200 Subject: crypto-arm: rework KERNEL_MODE_NEON handling It might be defined even if the compiler doesn't support it. Signed-off-by: Jason A. Donenfeld --- src/crypto/zinc/curve25519/curve25519-arm-glue.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/crypto/zinc/curve25519') diff --git a/src/crypto/zinc/curve25519/curve25519-arm-glue.h b/src/crypto/zinc/curve25519/curve25519-arm-glue.h index 27d387e..e9496b0 100644 --- a/src/crypto/zinc/curve25519/curve25519-arm-glue.h +++ b/src/crypto/zinc/curve25519/curve25519-arm-glue.h @@ -7,8 +7,12 @@ #include #include -#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && __LINUX_ARM_ARCH__ == 7 -#define ARM_USE_NEON +#define ARM_USE_NEON (defined(CONFIG_KERNEL_MODE_NEON) && \ + (defined(CONFIG_ARM64) || \ + (defined(__LINUX_ARM_ARCH__) && \ + __LINUX_ARM_ARCH__ == 7))) + +#if ARM_USE_NEON asmlinkage void curve25519_neon(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_POINT_SIZE], const u8 basepoint[CURVE25519_POINT_SIZE]); @@ -25,7 +29,7 @@ static inline bool curve25519_arch(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_POINT_SIZE], const u8 basepoint[CURVE25519_POINT_SIZE]) { -#ifdef ARM_USE_NEON +#if ARM_USE_NEON if (curve25519_use_neon && may_use_simd()) { kernel_neon_begin(); curve25519_neon(mypublic, secret, basepoint); -- cgit v1.2.3