Skip to content

Commit 289c270

Browse files
committed
mips/crc32: expose CRC32 functions through lib
Move the mips CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the arch-specific "shash" code becomes unnecessary and is removed. Note: to see the diff from arch/mips/crypto/crc32-mips.c to arch/mips/lib/crc32-mips.c, view this commit with 'git show -M10'. Reviewed-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Eric Biggers <[email protected]>
1 parent 72f51a4 commit 289c270

File tree

10 files changed

+195
-374
lines changed

10 files changed

+195
-374
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,11 +1995,11 @@ config CPU_MIPSR5
19951995
config CPU_MIPSR6
19961996
bool
19971997
default y if CPU_MIPS32_R6 || CPU_MIPS64_R6
1998+
select ARCH_HAS_CRC32
19981999
select CPU_HAS_RIXI
19992000
select CPU_HAS_DIEI if !CPU_DIEI_BROKEN
20002001
select HAVE_ARCH_BITREVERSE
20012002
select MIPS_ASID_BITS_VARIABLE
2002-
select MIPS_CRC_SUPPORT
20032003
select MIPS_SPRAM
20042004

20052005
config TARGET_ISA_REV
@@ -2475,9 +2475,6 @@ config MIPS_ASID_BITS
24752475
config MIPS_ASID_BITS_VARIABLE
24762476
bool
24772477

2478-
config MIPS_CRC_SUPPORT
2479-
bool
2480-
24812478
# R4600 erratum. Due to the lack of errata information the exact
24822479
# technical details aren't known. I've experimentally found that disabling
24832480
# interrupts during indexed I-cache flushes seems to be sufficient to deal

arch/mips/configs/eyeq5_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ CONFIG_NFS_V4=y
9999
CONFIG_NFS_V4_1=y
100100
CONFIG_NFS_V4_2=y
101101
CONFIG_ROOT_NFS=y
102-
CONFIG_CRYPTO_CRC32_MIPS=y
103102
CONFIG_FRAME_WARN=1024
104103
CONFIG_DEBUG_FS=y
105104
# CONFIG_RCU_TRACE is not set

arch/mips/configs/eyeq6_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ CONFIG_NFS_V4=y
102102
CONFIG_NFS_V4_1=y
103103
CONFIG_NFS_V4_2=y
104104
CONFIG_ROOT_NFS=y
105-
CONFIG_CRYPTO_CRC32_MIPS=y
106105
CONFIG_FRAME_WARN=1024
107106
CONFIG_DEBUG_FS=y
108107
# CONFIG_RCU_TRACE is not set

arch/mips/configs/generic/32r6.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
CONFIG_CPU_MIPS32_R6=y
22
CONFIG_HIGHMEM=y
3-
4-
CONFIG_CRYPTO_CRC32_MIPS=y

arch/mips/configs/generic/64r6.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ CONFIG_MIPS32_O32=y
44
CONFIG_MIPS32_N32=y
55

66
CONFIG_CPU_HAS_MSA=y
7-
CONFIG_CRYPTO_CRC32_MIPS=y
87
CONFIG_VIRTUALIZATION=y

arch/mips/crypto/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
menu "Accelerated Cryptographic Algorithms for CPU (mips)"
44

5-
config CRYPTO_CRC32_MIPS
6-
tristate "CRC32c and CRC32"
7-
depends on MIPS_CRC_SUPPORT
8-
select CRYPTO_HASH
9-
help
10-
CRC32c and CRC32 CRC algorithms
11-
12-
Architecture: mips
13-
145
config CRYPTO_POLY1305_MIPS
156
tristate "Hash functions: Poly1305"
167
depends on MIPS

arch/mips/crypto/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Makefile for MIPS crypto files..
44
#
55

6-
obj-$(CONFIG_CRYPTO_CRC32_MIPS) += crc32-mips.o
7-
86
obj-$(CONFIG_CRYPTO_CHACHA_MIPS) += chacha-mips.o
97
chacha-mips-y := chacha-core.o chacha-glue.o
108
AFLAGS_chacha-core.o += -O2 # needed to fill branch delay slots

0 commit comments

Comments
 (0)