mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
1ccd66f926156fbfc6399e7702c47c41e03523a0
The kernel modules aes-neon-blk and aes-neon-bs perform poorly, at least on Cortex-A72 without crypto extensions. In fact, aes-arm64 outperforms them on benchmarks, despite it being a simpler implementation (only accelerating the single-block AES cipher). For modes of operation where multiple cipher blocks can be processed in parallel, aes-neon-bs outperforms aes-neon-blk by around 60-70% and aes-arm64 is another 10-20% faster still. But the difference is even more marked with modes of operation with dependencies between neighbouring blocks, such as CBC encryption, which defeat parallelism: in these cases, aes-arm64 is typically around 250% faster than either aes-neon-blk or aes-neon-bs. The key trade-off with aes-arm64 is that the look-up tables are situated in RAM. This leaves them potentially open to cache timing attacks. The two other modules, by contrast, load the look-up tables into NEON registers and so are able to perform in constant time. This patch aims to load aes-arm64 more often. If none of the currently-loaded crypto modules implement a given algorithm, a new one is typically selected for loading using a platform-neutral alias describing the required algorithm. To enable users to still load aes-neon-blk or aes-neon-bs if they really want them, while still ensuring that aes-arm64 is usually selected, remove the aliases from aes-neonbs-glue.c and aes-glue.c and apply them to aes-cipher-glue.c, but still build the two NEON modules. Since aes-glue.c can also be used to build aes-ce-blk, leave them enabled if USE_V8_CRYPTO_EXTENSIONS is defined, to ensure they are selected if we in future use a CPU which has the crypto extensions enabled. Note that the algorithm priority specifiers are unchanged, so if aes-neon-bs is loaded at the same time as aes-arm64, the former will be used in preference. However, aes-neon-blk and aes-arm64 have tied priority, so whichever module was loaded first will be used (assuming aes-neon-bs is not loaded). Signed-off-by: Ben Avison <bavison@riscosopen.org>
Linux kernel
There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.
In order to build the documentation, use make htmldocs or
make pdfdocs. The formatted documentation can also be read online at:
https://www.kernel.org/doc/html/latest/
There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation.
Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.
Description
Languages
C
97.7%
Assembly
1.3%
Shell
0.3%
Makefile
0.3%
Python
0.2%
Other
0.1%