]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata
authorArd Biesheuvel <ardb@kernel.org>
Thu, 26 Nov 2020 07:49:07 +0000 (08:49 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:26:22 +0000 (14:26 +0100)
commitb014f64b04f14223f3cb01b4a156a90ff622f37d
tree22b752d332045396ca1b342ec79893279c491480
parent43d54b83ccd09cf0b06d1aae845872d3f799d10a
crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata

BugLink: https://bugs.launchpad.net/bugs/1910822
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/arm/crypto/aes-ce-core.S