diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2024-10-18 09:53:49 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2024-10-22 11:54:43 +0100 |
commit | fc7454107d1b7c27bb98d3b109e5f44a8a46d7f8 (patch) | |
tree | b128aa2bd94266c5d17634e3ba028144c7b6dc17 /arch/arm64/lib/crc32.S | |
parent | 9852d85ec9d492ebef56dc5f229416c925758edc (diff) | |
download | lwn-fc7454107d1b7c27bb98d3b109e5f44a8a46d7f8.tar.gz lwn-fc7454107d1b7c27bb98d3b109e5f44a8a46d7f8.zip |
arm64/lib: Handle CRC-32 alternative in C code
In preparation for adding another code path for performing CRC-32, move
the alternative patching for ARM64_HAS_CRC32 into C code. The logic for
deciding whether to use this new code path will be implemented in C too.
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20241018075347.2821102-6-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/lib/crc32.S')
-rw-r--r-- | arch/arm64/lib/crc32.S | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/arm64/lib/crc32.S b/arch/arm64/lib/crc32.S index 8340dccff46f..22139691c7ae 100644 --- a/arch/arm64/lib/crc32.S +++ b/arch/arm64/lib/crc32.S @@ -6,7 +6,6 @@ */ #include <linux/linkage.h> -#include <asm/alternative.h> #include <asm/assembler.h> .arch armv8-a+crc @@ -136,25 +135,16 @@ CPU_BE( rev16 \reg, \reg ) .endm .align 5 -SYM_FUNC_START(crc32_le) -alternative_if_not ARM64_HAS_CRC32 - b crc32_le_base -alternative_else_nop_endif +SYM_FUNC_START(crc32_le_arm64) __crc32 -SYM_FUNC_END(crc32_le) +SYM_FUNC_END(crc32_le_arm64) .align 5 -SYM_FUNC_START(__crc32c_le) -alternative_if_not ARM64_HAS_CRC32 - b __crc32c_le_base -alternative_else_nop_endif +SYM_FUNC_START(crc32c_le_arm64) __crc32 c -SYM_FUNC_END(__crc32c_le) +SYM_FUNC_END(crc32c_le_arm64) .align 5 -SYM_FUNC_START(crc32_be) -alternative_if_not ARM64_HAS_CRC32 - b crc32_be_base -alternative_else_nop_endif +SYM_FUNC_START(crc32_be_arm64) __crc32 be=1 -SYM_FUNC_END(crc32_be) +SYM_FUNC_END(crc32_be_arm64) |