Skip to content

Commit a578dd0

Browse files
committed
Merge tag 'crc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
Pull CRC updates from Eric Biggers: - Reorganize the architecture-optimized CRC code It now lives in lib/crc/$(SRCARCH)/ rather than arch/$(SRCARCH)/lib/, and it is no longer artificially split into separate generic and arch modules. This allows better inlining and dead code elimination The generic CRC code is also no longer exported, simplifying the API. (This mirrors the similar changes to SHA-1 and SHA-2 in lib/crypto/, which can be found in the "Crypto library updates" pull request) - Improve crc32c() performance on newer x86_64 CPUs on long messages by enabling the VPCLMULQDQ optimized code - Simplify the crypto_shash wrappers for crc32_le() and crc32c() Register just one shash algorithm for each that uses the (fully optimized) library functions, instead of unnecessarily providing direct access to the generic CRC code - Remove unused and obsolete drivers for hardware CRC engines - Remove CRC-32 combination functions that are no longer used - Add kerneldoc for crc32_le(), crc32_be(), and crc32c() - Convert the crc32() macro to an inline function * tag 'crc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: (26 commits) lib/crc: x86/crc32c: Enable VPCLMULQDQ optimization where beneficial lib/crc: x86: Reorganize crc-pclmul static_call initialization lib/crc: crc64: Add include/linux/crc64.h to kernel-api.rst lib/crc: crc32: Change crc32() from macro to inline function and remove cast nvmem: layouts: Switch from crc32() to crc32_le() lib/crc: crc32: Document crc32_le(), crc32_be(), and crc32c() lib/crc: Explicitly include <linux/export.h> lib/crc: Remove ARCH_HAS_* kconfig symbols lib/crc: x86: Migrate optimized CRC code into lib/crc/ lib/crc: sparc: Migrate optimized CRC code into lib/crc/ lib/crc: s390: Migrate optimized CRC code into lib/crc/ lib/crc: riscv: Migrate optimized CRC code into lib/crc/ lib/crc: powerpc: Migrate optimized CRC code into lib/crc/ lib/crc: mips: Migrate optimized CRC code into lib/crc/ lib/crc: loongarch: Migrate optimized CRC code into lib/crc/ lib/crc: arm64: Migrate optimized CRC code into lib/crc/ lib/crc: arm: Migrate optimized CRC code into lib/crc/ lib/crc: Prepare for arch-optimized code in subdirs of lib/crc/ lib/crc: Move files into lib/crc/ lib/crc32: Remove unused combination support ...
2 parents 8e736a2 + 118da22 commit a578dd0

101 files changed

Lines changed: 783 additions & 1703 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/core-api/kernel-api.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,26 +136,28 @@ Arithmetic Overflow Checking
136136
CRC Functions
137137
-------------
138138

139-
.. kernel-doc:: lib/crc4.c
139+
.. kernel-doc:: lib/crc/crc4.c
140140
:export:
141141

142-
.. kernel-doc:: lib/crc7.c
142+
.. kernel-doc:: lib/crc/crc7.c
143143
:export:
144144

145-
.. kernel-doc:: lib/crc8.c
145+
.. kernel-doc:: lib/crc/crc8.c
146146
:export:
147147

148-
.. kernel-doc:: lib/crc16.c
148+
.. kernel-doc:: lib/crc/crc16.c
149149
:export:
150150

151-
.. kernel-doc:: lib/crc32.c
152-
153-
.. kernel-doc:: lib/crc-ccitt.c
151+
.. kernel-doc:: lib/crc/crc-ccitt.c
154152
:export:
155153

156-
.. kernel-doc:: lib/crc-itu-t.c
154+
.. kernel-doc:: lib/crc/crc-itu-t.c
157155
:export:
158156

157+
.. kernel-doc:: include/linux/crc32.h
158+
159+
.. kernel-doc:: include/linux/crc64.h
160+
159161
Base 2 log and power Functions
160162
------------------------------
161163

MAINTAINERS

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6362,10 +6362,8 @@ L: linux-crypto@vger.kernel.org
63626362
S: Maintained
63636363
T: git https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git crc-next
63646364
F: Documentation/staging/crc*
6365-
F: arch/*/lib/crc*
63666365
F: include/linux/crc*
6367-
F: lib/crc*
6368-
F: lib/tests/crc_kunit.c
6366+
F: lib/crc/
63696367
F: scripts/gen-crc-consts.py
63706368

63716369
CREATIVE SB0540

arch/arm/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ config ARM
88
select ARCH_HAS_CACHE_LINE_SIZE if OF
99
select ARCH_HAS_CPU_CACHE_ALIASING
1010
select ARCH_HAS_CPU_FINALIZE_INIT if MMU
11-
select ARCH_HAS_CRC32 if KERNEL_MODE_NEON
12-
select ARCH_HAS_CRC_T10DIF if KERNEL_MODE_NEON
1311
select ARCH_HAS_CURRENT_STACK_POINTER
1412
select ARCH_HAS_DEBUG_VIRTUAL if MMU
1513
select ARCH_HAS_DMA_ALLOC if MMU

arch/arm/configs/multi_v7_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,6 @@ CONFIG_CRYPTO_DEV_MARVELL_CESA=m
12981298
CONFIG_CRYPTO_DEV_QCE=m
12991299
CONFIG_CRYPTO_DEV_QCOM_RNG=m
13001300
CONFIG_CRYPTO_DEV_ROCKCHIP=m
1301-
CONFIG_CRYPTO_DEV_STM32_CRC=m
13021301
CONFIG_CRYPTO_DEV_STM32_HASH=m
13031302
CONFIG_CRYPTO_DEV_STM32_CRYP=m
13041303
CONFIG_CMA_SIZE_MBYTES=64

arch/arm/lib/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,3 @@ ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
4747
endif
4848

4949
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
50-
51-
obj-$(CONFIG_CRC32_ARCH) += crc32-arm.o
52-
crc32-arm-y := crc32.o crc32-core.o
53-
54-
obj-$(CONFIG_CRC_T10DIF_ARCH) += crc-t10dif-arm.o
55-
crc-t10dif-arm-y := crc-t10dif.o crc-t10dif-core.o

arch/arm64/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ config ARM64
2121
select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
2222
select ARCH_HAS_CACHE_LINE_SIZE
2323
select ARCH_HAS_CC_PLATFORM
24-
select ARCH_HAS_CRC32
25-
select ARCH_HAS_CRC_T10DIF if KERNEL_MODE_NEON
2624
select ARCH_HAS_CURRENT_STACK_POINTER
2725
select ARCH_HAS_DEBUG_VIRTUAL
2826
select ARCH_HAS_DEBUG_VM_PGTABLE

arch/arm64/lib/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ endif
1616

1717
lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
1818

19-
obj-$(CONFIG_CRC32_ARCH) += crc32-arm64.o
20-
crc32-arm64-y := crc32.o crc32-core.o
21-
22-
obj-$(CONFIG_CRC_T10DIF_ARCH) += crc-t10dif-arm64.o
23-
crc-t10dif-arm64-y := crc-t10dif.o crc-t10dif-core.o
24-
2519
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
2620

2721
obj-$(CONFIG_ARM64_MTE) += mte.o

arch/loongarch/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ config LOONGARCH
1515
select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
1616
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
1717
select ARCH_HAS_CPU_FINALIZE_INIT
18-
select ARCH_HAS_CRC32
1918
select ARCH_HAS_CURRENT_STACK_POINTER
2019
select ARCH_HAS_DEBUG_VM_PGTABLE
2120
select ARCH_HAS_FAST_MULTIPLIER

arch/loongarch/lib/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ obj-$(CONFIG_ARCH_SUPPORTS_INT128) += tishift.o
1111
obj-$(CONFIG_CPU_HAS_LSX) += xor_simd.o xor_simd_glue.o
1212

1313
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
14-
15-
obj-$(CONFIG_CRC32_ARCH) += crc32-loongarch.o

arch/mips/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,6 @@ config CPU_MIPSR5
20242024
config CPU_MIPSR6
20252025
bool
20262026
default y if CPU_MIPS32_R6 || CPU_MIPS64_R6
2027-
select ARCH_HAS_CRC32
20282027
select CPU_HAS_RIXI
20292028
select CPU_HAS_DIEI if !CPU_DIEI_BROKEN
20302029
select HAVE_ARCH_BITREVERSE

0 commit comments

Comments
 (0)