linux/arch/arm64
Ard Biesheuvel b6a11be5c4 crypto: arm64/aes-ce-cipher - move assembler code to .S file
commit 019cd46984 upstream.

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>
Cc: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2018-04-12 12:32:21 +02:00
..
boot arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset 2018-03-19 08:42:55 +01:00
configs ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
crypto crypto: arm64/aes-ce-cipher - move assembler code to .S file 2018-04-12 12:32:21 +02:00
include kmemcheck: stop using GFP_NOTRACK and SLAB_NOTRACK 2018-02-22 15:42:23 +01:00
kernel arm64: cpufeature: Fix CTR_EL0 field definitions 2018-02-28 10:19:42 +01:00
kvm arm64: Add missing Falkor part number for branch predictor hardening 2018-02-22 15:42:25 +01:00
lib arm64: uaccess: Mask __user pointers for __arch_{clear, copy_*}_user 2018-02-16 20:22:52 +01:00
mm mm/vmalloc: add interfaces to free unmapped page table 2018-03-28 18:24:38 +02:00
net bpf, arm64: fix out of bounds access in tail call 2018-03-11 16:23:22 +01:00
xen arm64: kpti: Fix the interaction between ASID switching and software PAN 2018-02-16 20:22:49 +01:00
Kconfig arm64: Add skeleton to harden the branch predictor against aliasing attacks 2018-02-16 20:22:53 +01:00
Kconfig.debug arm64: relocation testing module 2017-04-04 17:03:32 +01:00
Kconfig.platforms ARM: arm64: Devicetree updates for v4.14 2017-09-10 20:54:48 -07:00
Makefile arm64: prevent regressions in compressed kernel image size when upgrading to binutils 2.27 2017-12-20 10:10:29 +01:00