]> git.ipfire.org Git - thirdparty/linux.git/commit - arch/arm64/Kconfig
arm64/lib: add accelerated crc32 routines
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 27 Aug 2018 11:02:44 +0000 (13:02 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 10 Sep 2018 15:10:53 +0000 (16:10 +0100)
commit7481cddf29ede204b475facc40e6f65459939881
tree6f6f52d229d753fdb0c1b19aa23e94f329683d62
parent86d0dd34eafffbc76a81aba6ae2d71927d3835a8
arm64/lib: add accelerated crc32 routines

Unlike crc32c(), which is wired up to the crypto API internally so the
optimal driver is selected based on the platform's capabilities,
crc32_le() is implemented as a library function using a slice-by-8 table
based C implementation. Even though few of the call sites may be
bottlenecks, calling a time variant implementation with a non-negligible
D-cache footprint is a bit of a waste, given that ARMv8.1 and up mandates
support for the CRC32 instructions that were optional in ARMv8.0, but are
already widely available, even on the Cortex-A53 based Raspberry Pi.

So implement routines that use these instructions if available, and fall
back to the existing generic routines otherwise. The selection is based
on alternatives patching.

Note that this unconditionally selects CONFIG_CRC32 as a builtin. Since
CRC32 is relied upon by core functionality such as CONFIG_OF_FLATTREE,
this just codifies the status quo.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/Kconfig
arch/arm64/lib/Makefile
arch/arm64/lib/crc32.S [new file with mode: 0644]