]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/aes-ce-cipher - move assembler code to .S file
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 21 Nov 2017 13:40:17 +0000 (13:40 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Nov 2017 06:33:30 +0000 (17:33 +1100)
commite64693aaabec8e48d3669566272fc4ad82927a52
tree82892f2172b3ba17e76d31d38c38743cf2f07011
parent9cf3c1a4fb733b6e834c388ce8d07d8a0b76fe48
crypto: arm64/aes-ce-cipher - move assembler code to .S file

Most crypto drivers involving kernel mode NEON take care to put the code
that actually touches the NEON register file in a separate compilation
unit, to prevent the compiler from reordering code that preserves or
restores the NEON context with code that may corrupt it. This is
necessary because we currently have no way to express the restrictions
imposed upon use of the NEON in kernel mode in a way that the compiler
understands.

However, in the case of aes-ce-cipher, it did not seem unreasonable to
deviate from this rule, given how it does not seem possible for the
compiler to reorder cross object function calls with asm blocks whose
in- and output constraints reflect that it reads from and writes to
memory.

Now that LTO is being proposed for the arm64 kernel, it is time to
revisit this. The link time optimization may replace the function
calls to kernel_neon_begin() and kernel_neon_end() with instantiations
of the IR that make up its implementation, allowing further reordering
with the asm block.

So let's clean this up, and move the asm() blocks into a separate .S
file.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-By: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/Makefile
arch/arm64/crypto/aes-ce-cipher.c [deleted file]
arch/arm64/crypto/aes-ce-core.S [new file with mode: 0644]
arch/arm64/crypto/aes-ce-glue.c [new file with mode: 0644]