Skip to content

Commit 0080719

Browse files
committed
s390/crc32: expose CRC32 functions through lib
Move the s390 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/s390/crypto/crc32-vx.c to arch/s390/lib/crc32-glue.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 372ff60 commit 0080719

File tree

11 files changed

+96
-322
lines changed

11 files changed

+96
-322
lines changed

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ config S390
7272
select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
7373
select ARCH_ENABLE_MEMORY_HOTREMOVE
7474
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
75+
select ARCH_HAS_CRC32
7576
select ARCH_HAS_CURRENT_STACK_POINTER
7677
select ARCH_HAS_DEBUG_VIRTUAL
7778
select ARCH_HAS_DEBUG_VM_PGTABLE

arch/s390/configs/debug_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ CONFIG_CRYPTO_USER_API_HASH=m
795795
CONFIG_CRYPTO_USER_API_SKCIPHER=m
796796
CONFIG_CRYPTO_USER_API_RNG=m
797797
CONFIG_CRYPTO_USER_API_AEAD=m
798-
CONFIG_CRYPTO_CRC32_S390=y
799798
CONFIG_CRYPTO_SHA512_S390=m
800799
CONFIG_CRYPTO_SHA1_S390=m
801800
CONFIG_CRYPTO_SHA256_S390=m

arch/s390/configs/defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ CONFIG_CRYPTO_USER_API_HASH=m
782782
CONFIG_CRYPTO_USER_API_SKCIPHER=m
783783
CONFIG_CRYPTO_USER_API_RNG=m
784784
CONFIG_CRYPTO_USER_API_AEAD=m
785-
CONFIG_CRYPTO_CRC32_S390=y
786785
CONFIG_CRYPTO_SHA512_S390=m
787786
CONFIG_CRYPTO_SHA1_S390=m
788787
CONFIG_CRYPTO_SHA256_S390=m

arch/s390/crypto/Kconfig

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

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

5-
config CRYPTO_CRC32_S390
6-
tristate "CRC32c and CRC32"
7-
depends on S390
8-
select CRYPTO_HASH
9-
select CRC32
10-
help
11-
CRC32c and CRC32 CRC algorithms
12-
13-
Architecture: s390
14-
15-
It is available with IBM z13 or later.
16-
175
config CRYPTO_SHA512_S390
186
tristate "Hash functions: SHA-384 and SHA-512"
197
depends on S390

arch/s390/crypto/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ obj-$(CONFIG_CRYPTO_PAES_S390) += paes_s390.o
1414
obj-$(CONFIG_CRYPTO_CHACHA_S390) += chacha_s390.o
1515
obj-$(CONFIG_S390_PRNG) += prng.o
1616
obj-$(CONFIG_CRYPTO_GHASH_S390) += ghash_s390.o
17-
obj-$(CONFIG_CRYPTO_CRC32_S390) += crc32-vx_s390.o
1817
obj-$(CONFIG_CRYPTO_HMAC_S390) += hmac_s390.o
1918
obj-y += arch_random.o
2019

21-
crc32-vx_s390-y := crc32-vx.o crc32le-vx.o crc32be-vx.o
2220
chacha_s390-y := chacha-glue.o chacha-s390.o

arch/s390/crypto/crc32-vx.c

Lines changed: 0 additions & 306 deletions
This file was deleted.

arch/s390/lib/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o
2424
lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
2525

2626
obj-$(CONFIG_EXPOLINE_EXTERN) += expoline.o
27+
28+
obj-$(CONFIG_CRC32_ARCH) += crc32-s390.o
29+
crc32-s390-y := crc32-glue.o crc32le-vx.o crc32be-vx.o

0 commit comments

Comments
 (0)