Patch "crypto: arm64/aes-ce-cipher - move assembler code to .S file" has been added to the 4.14-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
crypto: arm64/aes-ce-cipher - move assembler code to .S file
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
crypto-arm64-aes-ce-cipher-move-assembler-code-to-.s-file.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
019cd46984d04703a39924178f503a98436ac0d7Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Tue, 21 Nov 2017 13:40:17 +0000
Subject: crypto: arm64/aes-ce-cipher - move assembler code to .S file
From: Ard Biesheuvel <[email protected]>
commit 019cd46984d04703a39924178f503a98436ac0d7 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.
--- arch/arm64/crypto/Makefile | 2 arch/arm64/crypto/aes-ce-cipher.c | 281 -------------------------------------- arch/arm64/crypto/aes-ce-core.S | 87 +++++++++++ arch/arm64/crypto/aes-ce-glue.c | 190 +++++++++++++++++++++++++ 4 files changed, 278 insertions(+), 282 deletions(-)
arch/arm64/crypto/Makefile +1 -1
@@ -24,7 +24,7 @@ obj-$(CONFIG_CRYPTO_CRC32_ARM64_CE) += c crc32-ce-y:= crc32-ce-core.o crc32-ce-glue.o obj-$(CONFIG_CRYPTO_AES_ARM64_CE) += aes-ce-cipher.o -CFLAGS_aes-ce-cipher.o += -march=armv8-a+crypto +aes-ce-cipher-y := aes-ce-core.o aes-ce-glue.o obj-$(CONFIG_CRYPTO_AES_ARM64_CE_CCM) += aes-ce-ccm.o aes-ce-ccm-y := aes-ce-ccm-glue.o aes-ce-ccm-core.o
arch/arm64/crypto/aes-ce-cipher.c deleted +0 -281
281 lines not on this page · raw message
arch/arm64/crypto/aes-ce-core.S new file +87 -0
87 lines not on this page · raw message
arch/arm64/crypto/aes-ce-glue.c new file +190 -0
190 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/crypto-arm64-aes-ce-cipher-move-assembler-code-to-.s-file.patch queue-4.14/crypto-aes-generic-build-with-os-on-gcc-7.patch