Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: arm/nhpoly1305 - eliminate unnecessary CFI wrapper

The arm architecture doesn't support CFI yet, and even if it did, the
new CFI implementation supports indirect calls to assembly functions.
Therefore, there's no need to use a wrapper function for nh_neon().

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
cc7acaad be8f6b64

+3 -10
+1 -1
arch/arm/crypto/nh-neon-core.S
··· 69 69 70 70 /* 71 71 * void nh_neon(const u32 *key, const u8 *message, size_t message_len, 72 - * u8 hash[NH_HASH_BYTES]) 72 + * __le64 hash[NH_NUM_PASSES]) 73 73 * 74 74 * It's guaranteed that message_len % 16 == 0. 75 75 */
+2 -9
arch/arm/crypto/nhpoly1305-neon-glue.c
··· 14 14 #include <linux/module.h> 15 15 16 16 asmlinkage void nh_neon(const u32 *key, const u8 *message, size_t message_len, 17 - u8 hash[NH_HASH_BYTES]); 18 - 19 - /* wrapper to avoid indirect call to assembly, which doesn't work with CFI */ 20 - static void _nh_neon(const u32 *key, const u8 *message, size_t message_len, 21 - __le64 hash[NH_NUM_PASSES]) 22 - { 23 - nh_neon(key, message, message_len, (u8 *)hash); 24 - } 17 + __le64 hash[NH_NUM_PASSES]); 25 18 26 19 static int nhpoly1305_neon_update(struct shash_desc *desc, 27 20 const u8 *src, unsigned int srclen) ··· 26 33 unsigned int n = min_t(unsigned int, srclen, SZ_4K); 27 34 28 35 kernel_neon_begin(); 29 - crypto_nhpoly1305_update_helper(desc, src, n, _nh_neon); 36 + crypto_nhpoly1305_update_helper(desc, src, n, nh_neon); 30 37 kernel_neon_end(); 31 38 src += n; 32 39 srclen -= n;