kernel: build arm/neon-optimized sha1/512 modules

This builds the regular arm and arm-neon asm optmized modules for sha1
and sha512, for targets that set CONFIG_ARM_CRYPTO.

On ip40xx, the arm-asm version of sha1 improves performance by 5% over
the generic C implementation; sha1-neon is 25% faster than generic,
and sha512-neon, 259%.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
master
Eneas U de Queiroz 2020-02-24 14:37:58 -03:00 committed by Christian Lamparter
parent 285df63efc
commit e889489bed
1 changed files with 35 additions and 0 deletions

View File

@ -682,6 +682,8 @@ define KernelPackage/crypto-sha1
DEPENDS:=+kmod-crypto-hash DEPENDS:=+kmod-crypto-hash
KCONFIG:= \ KCONFIG:= \
CONFIG_CRYPTO_SHA1 \ CONFIG_CRYPTO_SHA1 \
CONFIG_CRYPTO_SHA1_ARM \
CONFIG_CRYPTO_SHA1_ARM_NEON \
CONFIG_CRYPTO_SHA1_OCTEON \ CONFIG_CRYPTO_SHA1_OCTEON \
CONFIG_CRYPTO_SHA1_SSSE3 CONFIG_CRYPTO_SHA1_SSSE3
FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko FILES:=$(LINUX_DIR)/crypto/sha1_generic.ko
@ -689,11 +691,30 @@ define KernelPackage/crypto-sha1
$(call AddDepends/crypto) $(call AddDepends/crypto)
endef endef
define KernelPackage/crypto-sha1/arm
FILES+=$(LINUX_DIR)/arch/arm/crypto/sha1-arm.ko
AUTOLOAD+=$(call AutoLoad,09,sha1-arm)
endef
define KernelPackage/crypto-sha1/arm-neon
$(call KernelPackage/crypto-sha1/arm)
FILES+=$(LINUX_DIR)/arch/arm/crypto/sha1-arm-neon.ko
AUTOLOAD+=$(call AutoLoad,09,sha1-arm-neon)
endef
KernelPackage/crypto-sha1/imx6=$(KernelPackage/crypto-sha1/arm-neon)
KernelPackage/crypto-sha1/ipq40xx=$(KernelPackage/crypto-sha1/arm-neon)
KernelPackage/crypto-sha1/mvebu=$(KernelPackage/crypto-sha1/arm-neon)
define KernelPackage/crypto-sha1/octeon define KernelPackage/crypto-sha1/octeon
FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha1.ko
AUTOLOAD+=$(call AutoLoad,09,octeon-sha1) AUTOLOAD+=$(call AutoLoad,09,octeon-sha1)
endef endef
KernelPackage/crypto-sha1/tegra=$(KernelPakcage/crypto-sha1/arm)
define KernelPackage/crypto-sha1/x86/64 define KernelPackage/crypto-sha1/x86/64
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko FILES+=$(LINUX_DIR)/arch/x86/crypto/sha1-ssse3.ko
AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3) AUTOLOAD+=$(call AutoLoad,09,sha1-ssse3)
@ -734,6 +755,7 @@ define KernelPackage/crypto-sha512
DEPENDS:=+kmod-crypto-hash DEPENDS:=+kmod-crypto-hash
KCONFIG:= \ KCONFIG:= \
CONFIG_CRYPTO_SHA512 \ CONFIG_CRYPTO_SHA512 \
CONFIG_CRYPTO_SHA512_ARM \
CONFIG_CRYPTO_SHA512_OCTEON \ CONFIG_CRYPTO_SHA512_OCTEON \
CONFIG_CRYPTO_SHA512_SSSE3 CONFIG_CRYPTO_SHA512_SSSE3
FILES:=$(LINUX_DIR)/crypto/sha512_generic.ko FILES:=$(LINUX_DIR)/crypto/sha512_generic.ko
@ -741,11 +763,24 @@ define KernelPackage/crypto-sha512
$(call AddDepends/crypto) $(call AddDepends/crypto)
endef endef
define KernelPackage/crypto-sha512/arm
FILES+=$(LINUX_DIR)/arch/arm/crypto/sha512-arm.ko
AUTOLOAD+=$(call AutoLoad,09,sha512-arm)
endef
KernelPackage/crypto-sha512/imx6=$(KernelPackage/crypto-sha512/arm)
KernelPackage/crypto-sha512/ipq40xx=$(KernelPackage/crypto-sha512/arm)
KernelPackage/crypto-sha512/mvebu=$(KernelPackage/crypto-sha512/arm)
define KernelPackage/crypto-sha512/octeon define KernelPackage/crypto-sha512/octeon
FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha512.ko FILES+=$(LINUX_DIR)/arch/mips/cavium-octeon/crypto/octeon-sha512.ko
AUTOLOAD+=$(call AutoLoad,09,octeon-sha512) AUTOLOAD+=$(call AutoLoad,09,octeon-sha512)
endef endef
KernelPackage/crypto-sha512/tegra=$(KernelPackage/crypto-sha512/arm)
define KernelPackage/crypto-sha512/x86/64 define KernelPackage/crypto-sha512/x86/64
FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko FILES+=$(LINUX_DIR)/arch/x86/crypto/sha512-ssse3.ko
AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3) AUTOLOAD+=$(call AutoLoad,09,sha512-ssse3)