Commit 372ff60a authored by Eric Biggers's avatar Eric Biggers
Browse files

powerpc/crc32: expose CRC32 functions through lib



Move the powerpc CRC32C 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/powerpc/crypto/crc32c-vpmsum_glue.c to
arch/powerpc/lib/crc32-glue.c, view this commit with 'git show -M10'.

Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20241202010844.144356-9-ebiggers@kernel.org


Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent 289c270e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ config PPC
	select ARCH_ENABLE_MEMORY_HOTPLUG
	select ARCH_ENABLE_MEMORY_HOTREMOVE
	select ARCH_HAS_COPY_MC			if PPC64
	select ARCH_HAS_CRC32			if PPC64 && ALTIVEC
	select ARCH_HAS_CURRENT_STACK_POINTER
	select ARCH_HAS_DEBUG_VIRTUAL
	select ARCH_HAS_DEBUG_VM_PGTABLE
+0 −1
Original line number Diff line number Diff line
@@ -320,7 +320,6 @@ CONFIG_XMON=y
CONFIG_CRYPTO_TEST=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_CRC32C_VPMSUM=m
CONFIG_CRYPTO_CRCT10DIF_VPMSUM=m
CONFIG_CRYPTO_MD5_PPC=m
CONFIG_CRYPTO_MICHAEL_MIC=m
+0 −1
Original line number Diff line number Diff line
@@ -389,7 +389,6 @@ CONFIG_CRYPTO_MICHAEL_MIC=m
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_WP512=m
CONFIG_CRYPTO_LZO=m
CONFIG_CRYPTO_CRC32C_VPMSUM=m
CONFIG_CRYPTO_CRCT10DIF_VPMSUM=m
CONFIG_CRYPTO_VPMSUM_TESTER=m
CONFIG_CRYPTO_MD5_PPC=m
+1 −14
Original line number Diff line number Diff line
@@ -13,19 +13,6 @@ config CRYPTO_CURVE25519_PPC64
	  Architecture: PowerPC64
	  - Little-endian

config CRYPTO_CRC32C_VPMSUM
	tristate "CRC32c"
	depends on PPC64 && ALTIVEC
	select CRYPTO_HASH
	select CRC32
	help
	  CRC32c CRC algorithm with the iSCSI polynomial (RFC 3385 and RFC 3720)

	  Architecture: powerpc64 using
	  - AltiVec extensions

	  Enable on POWER8 and newer processors for improved performance.

config CRYPTO_CRCT10DIF_VPMSUM
	tristate "CRC32T10DIF"
	depends on PPC64 && ALTIVEC && CRC_T10DIF
@@ -40,7 +27,7 @@ config CRYPTO_CRCT10DIF_VPMSUM

config CRYPTO_VPMSUM_TESTER
	tristate "CRC32c and CRC32T10DIF hardware acceleration tester"
	depends on CRYPTO_CRCT10DIF_VPMSUM && CRYPTO_CRC32C_VPMSUM
	depends on CRYPTO_CRCT10DIF_VPMSUM && CRYPTO_CRC32C && CRC32_ARCH
	help
	  Stress test for CRC32c and CRCT10DIF algorithms implemented with
	  powerpc64 AltiVec extensions (POWER8 vpmsum instructions).
+0 −2
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ obj-$(CONFIG_CRYPTO_MD5_PPC) += md5-ppc.o
obj-$(CONFIG_CRYPTO_SHA1_PPC) += sha1-powerpc.o
obj-$(CONFIG_CRYPTO_SHA1_PPC_SPE) += sha1-ppc-spe.o
obj-$(CONFIG_CRYPTO_SHA256_PPC_SPE) += sha256-ppc-spe.o
obj-$(CONFIG_CRYPTO_CRC32C_VPMSUM) += crc32c-vpmsum.o
obj-$(CONFIG_CRYPTO_CRCT10DIF_VPMSUM) += crct10dif-vpmsum.o
obj-$(CONFIG_CRYPTO_VPMSUM_TESTER) += crc-vpmsum_test.o
obj-$(CONFIG_CRYPTO_AES_GCM_P10) += aes-gcm-p10-crypto.o
@@ -24,7 +23,6 @@ md5-ppc-y := md5-asm.o md5-glue.o
sha1-powerpc-y := sha1-powerpc-asm.o sha1.o
sha1-ppc-spe-y := sha1-spe-asm.o sha1-spe-glue.o
sha256-ppc-spe-y := sha256-spe-asm.o sha256-spe-glue.o
crc32c-vpmsum-y := crc32c-vpmsum_asm.o crc32c-vpmsum_glue.o
crct10dif-vpmsum-y := crct10dif-vpmsum_asm.o crct10dif-vpmsum_glue.o
aes-gcm-p10-crypto-y := aes-gcm-p10-glue.o aes-gcm-p10.o ghashp10-ppc.o aesp10-ppc.o
chacha-p10-crypto-y := chacha-p10-glue.o chacha-p10le-8x.o
Loading