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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: arm64/nhpoly1305 - eliminate unnecessary CFI wrapper

Since the CFI implementation now supports indirect calls to assembly
functions, take advantage of that rather than use a wrapper function.

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
e5e1c67e 2d203c46

+5 -11
+3 -2
arch/arm64/crypto/nh-neon-core.S
··· 8 8 */ 9 9 10 10 #include <linux/linkage.h> 11 + #include <linux/cfi_types.h> 11 12 12 13 KEY .req x0 13 14 MESSAGE .req x1 ··· 59 58 60 59 /* 61 60 * void nh_neon(const u32 *key, const u8 *message, size_t message_len, 62 - * u8 hash[NH_HASH_BYTES]) 61 + * __le64 hash[NH_NUM_PASSES]) 63 62 * 64 63 * It's guaranteed that message_len % 16 == 0. 65 64 */ 66 - SYM_FUNC_START(nh_neon) 65 + SYM_TYPED_FUNC_START(nh_neon) 67 66 68 67 ld1 {K0.4s,K1.4s}, [KEY], #32 69 68 movi PASS0_SUMS.2d, #0
+2 -9
arch/arm64/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;