summaryrefslogtreecommitdiff
path: root/arch/x86/crypto/chacha_glue.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-05-07 08:10:13 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-07 08:10:13 +0300
commit3793faad7b5b730941b2efbc252d14374b60843a (patch)
treee1bea43727d87f8fd30ca169f465a3591f15d63b /arch/x86/crypto/chacha_glue.c
parentae1804de93f6f1626906567ae7deec8e0111259d (diff)
parenta811c1fa0a02c062555b54651065899437bacdbe (diff)
downloadlinux-3793faad7b5b730941b2efbc252d14374b60843a.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Conflicts were all overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/x86/crypto/chacha_glue.c')
-rw-r--r--arch/x86/crypto/chacha_glue.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/crypto/chacha_glue.c b/arch/x86/crypto/chacha_glue.c
index b412c21ee06e..22250091cdbe 100644
--- a/arch/x86/crypto/chacha_glue.c
+++ b/arch/x86/crypto/chacha_glue.c
@@ -153,9 +153,17 @@ void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes,
bytes <= CHACHA_BLOCK_SIZE)
return chacha_crypt_generic(state, dst, src, bytes, nrounds);
- kernel_fpu_begin();
- chacha_dosimd(state, dst, src, bytes, nrounds);
- kernel_fpu_end();
+ do {
+ unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
+
+ kernel_fpu_begin();
+ chacha_dosimd(state, dst, src, todo, nrounds);
+ kernel_fpu_end();
+
+ bytes -= todo;
+ src += todo;
+ dst += todo;
+ } while (bytes);
}
EXPORT_SYMBOL(chacha_crypt_arch);