loongarch/crc32: expose CRC32 functions through libMove the loongarch CRC32 assembly code into the lib directory and wireit up to the library interface. This allows it to be used without goingth
loongarch/crc32: expose CRC32 functions through libMove the loongarch CRC32 assembly code into the lib directory and wireit up to the library interface. This allows it to be used without goingthrough the crypto API. It remains usable via the crypto API too viathe shash algorithms that use the library interface. Thus all thearch-specific "shash" code becomes unnecessary and is removed.Note: to see the diff from arch/loongarch/crypto/crc32-loongarch.c toarch/loongarch/lib/crc32-loongarch.c, view this commit with'git show -M10'.Reviewed-by: Ard Biesheuvel <ardb@kernel.org>Reviewed-by: WangYuli <wangyuli@uniontech.com>Link: https://lore.kernel.org/r/20241202010844.144356-7-ebiggers@kernel.orgSigned-off-by: Eric Biggers <ebiggers@google.com>
show more ...
move asm/unaligned.h to linux/unaligned.hasm/unaligned.h is always an include of asm-generic/unaligned.h;might as well move that thing to linux/unaligned.h and includethat - there's nothing arch-
move asm/unaligned.h to linux/unaligned.hasm/unaligned.h is always an include of asm-generic/unaligned.h;might as well move that thing to linux/unaligned.h and includethat - there's nothing arch-specific in that header.auto-generated by the following:for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $idonefor i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $idonegit mv include/asm-generic/unaligned.h include/linux/unaligned.hgit mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.hsed -i -e "/unaligned.h/d" include/asm-generic/Kbuildsed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
LoongArch/crypto: Clean up useless assignment operationsThe LoongArch CRC32 hw acceleration is based on arch/mips/crypto/crc32-mips.c. While the MIPS code supports both MIPS32 and MIPS64,but Loon
LoongArch/crypto: Clean up useless assignment operationsThe LoongArch CRC32 hw acceleration is based on arch/mips/crypto/crc32-mips.c. While the MIPS code supports both MIPS32 and MIPS64,but LoongArch32 lacks the CRC instruction. As a result, the line"len -= sizeof(u32)" is unnecessary.Removing it can make context code style more unified and improvecode readability.Cc: stable@vger.kernel.orgReviewed-by: WANG Xuerui <git@xen0n.name>Suggested-by: Wentao Guan <guanwentao@uniontech.com>Signed-off-by: Yuli Wang <wangyuli@uniontech.com>Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
crypto: loongarch/crc32 - remove redundant setting of alignmask to 0This unnecessary explicit setting of cra_alignmask to 0 shows up whengrepping for shash algorithms that set an alignmask. Remov
crypto: loongarch/crc32 - remove redundant setting of alignmask to 0This unnecessary explicit setting of cra_alignmask to 0 shows up whengrepping for shash algorithms that set an alignmask. Remove it. Nochange in behavior.Signed-off-by: Eric Biggers <ebiggers@google.com>Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
LoongArch: crypto: Add crc32 and crc32c hw accelerationWith a blatant copy of some MIPS bits we introduce the crc32 and crc32chw accelerated module to LoongArch.LoongArch has provided these inst
LoongArch: crypto: Add crc32 and crc32c hw accelerationWith a blatant copy of some MIPS bits we introduce the crc32 and crc32chw accelerated module to LoongArch.LoongArch has provided these instructions to calculate crc32 and crc32c: * crc.w.b.w crcc.w.b.w * crc.w.h.w crcc.w.h.w * crc.w.w.w crcc.w.w.w * crc.w.d.w crcc.w.d.wSo we can make use of these instructions to improve the performance ofcalculation for crc32(c) checksums.As can be seen from the following test results, crc32(c) instructionscan improve the performance by 58%. Software implemention Hardware acceleration Buffer size time cost (seconds) time cost (seconds) Accel. 100 KB 0.000845 0.000534 59.1% 1 MB 0.007758 0.004836 59.4% 10 MB 0.076593 0.047682 59.4% 100 MB 0.756734 0.479126 58.5% 1000 MB 7.563841 4.778266 58.5%Signed-off-by: Min Zhou <zhoumin@loongson.cn>Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>