linux/arch/arm/crypto
Ard Biesheuvel f9189a3bb5 crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata
commit f3456b9fd269c6d0c973b136c5449d46b2510f4b upstream.

ARM Cortex-A57 and Cortex-A72 cores running in 32-bit mode are affected
by silicon errata #1742098 and #1655431, respectively, where the second
instruction of a AES instruction pair may execute twice if an interrupt
is taken right after the first instruction consumes an input register of
which a single 32-bit lane has been updated the last time it was modified.

This is not such a rare occurrence as it may seem: in counter mode, only
the least significant 32-bit word is incremented in the absence of a
carry, which makes our counter mode implementation susceptible to these
errata.

So let's shuffle the counter assignments around a bit so that the most
recent updates when the AES instruction pair executes are 128-bit wide.

[0] ARM-EPM-049219 v23 Cortex-A57 MPCore Software Developers Errata Notice
[1] ARM-EPM-012079 v11.0 Cortex-A72 MPCore Software Developers Errata Notice

Cc: <stable@vger.kernel.org> # v5.4+
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:51:36 +01:00
..
.gitignore
Kconfig
Makefile
aes-ce-core.S
aes-ce-glue.c
aes-cipher-core.S
aes-cipher-glue.c
aes-neonbs-core.S
aes-neonbs-glue.c
chacha-neon-core.S
chacha-neon-glue.c
crc32-ce-core.S
crc32-ce-glue.c
crct10dif-ce-core.S
crct10dif-ce-glue.c
ghash-ce-core.S
ghash-ce-glue.c
nh-neon-core.S
nhpoly1305-neon-glue.c
sha1-armv4-large.S
sha1-armv7-neon.S
sha1-ce-core.S
sha1-ce-glue.c
sha1.h
sha1_glue.c
sha1_neon_glue.c
sha2-ce-core.S
sha2-ce-glue.c
sha256-armv4.pl
sha256-core.S_shipped
sha256_glue.c
sha256_glue.h
sha256_neon_glue.c
sha512-armv4.pl
sha512-core.S_shipped
sha512-glue.c
sha512-neon-glue.c
sha512.h