diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-03-10 15:21:49 +0000 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-03-16 23:35:55 +0800 |
commit | 78ad7b08d8e096e5f00bc2cbeba9ef6d24be1bc4 (patch) | |
tree | 7d33ca3298c706b3326d06114946af7355fd25de /arch/arm64/crypto/sm3-ce-core.S | |
parent | 6833817472702658bdce64ea56bb90813be85557 (diff) |
crypto: arm64/aes-bs - move kernel mode neon en/disable into loop
When kernel mode NEON was first introduced on arm64, the preserve and
restore of the userland NEON state was completely unoptimized, and
involved saving all registers on each call to kernel_neon_begin(),
and restoring them on each call to kernel_neon_end(). For this reason,
the NEON crypto code that was introduced at the time keeps the NEON
enabled throughout the execution of the crypto API methods, which may
include calls back into the crypto API that could result in memory
allocation or other actions that we should avoid when running with
preemption disabled.
Since then, we have optimized the kernel mode NEON handling, which now
restores lazily (upon return to userland), and so the preserve action
is only costly the first time it is called after entering the kernel.
So let's put the kernel_neon_begin() and kernel_neon_end() calls around
the actual invocations of the NEON crypto code, and run the remainder of
the code with kernel mode NEON disabled (and preemption enabled)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm64/crypto/sm3-ce-core.S')
0 files changed, 0 insertions, 0 deletions