From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92C2ECD4F3C for ; Mon, 18 May 2026 05:19:21 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gJmLw2SP3z3bwf; Mon, 18 May 2026 15:19:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:7c80:54:3::133" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1779081560; cv=none; b=jdh0A893qe4qYW4+Y13ur97O9HYsR5RUDuTZTJLqBwlzkYXzuNCOeqZ4Iq8oQR69whXq9SD1DiHsLPWyDmU/IhjlHbd9ZitK+ONSA6Nv2PKEa79nVCYOvps0VHhnwsrT1o2anE1dDtJD1C2dB0wVbLOQehcnYt6Ce07PzkyEfk77x4QIdBjWdVLfY24fE3rBJrDXv3uQa95nfp4Aesx7A0ncgaKSCEC4+I+OsenpqDs3CoHA4tqwJ3CdICfg8sQgEntke5h1WKFFxj6zwZU8Av1hF+4EQkJx0CjHebQVUMSlnwjpsRYKCi+q6T5UpWael5gjkrSlvCoOjNOnwXLEGQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1779081560; c=relaxed/relaxed; bh=lsHXYIM3P1M+yO9RsMlwxeQWLyulusrmln84gA1zZ9U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bNqa/JPKgaWnnAddvISVOBaOZ/uaWaoynUbdT5qC4BOaiv0eTvtUg7eAFfCz05N1WVRNaq9Muy4h3JqoN0xP7ZxsNDxusPEi6ulbEHT/7GQ7KSKqXjOXEB2B9ECn1tk55KtlT6z1vNVuanl5R9f/wZEGRshp9N29UdfrxhQO7uZlQYiAiUsY0Z8/3+UOR3Dh8Cy0jPa6frwejgWknuhTcwgEFJHx+H5hIljQxnjkQblCr9ViKGGyNWzXYi75XIgj8wpM9+Vd0YUommWPcmKhB5hMGpGnhSvjWulagw8kpEDp5fxj6zMmFCQkHH/Jg180vSzVeGm5og7DYnuLVnGIiA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=lst.de; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=udUvafzB; dkim-atps=neutral; spf=none (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=batv+a5a5d3dd39d7e5270008+8303+infradead.org+hch@bombadil.srs.infradead.org; receiver=lists.ozlabs.org) smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=udUvafzB; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=bombadil.srs.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=batv+a5a5d3dd39d7e5270008+8303+infradead.org+hch@bombadil.srs.infradead.org; receiver=lists.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4gJmLt4TX2z3bwX for ; Mon, 18 May 2026 15:19:18 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=lsHXYIM3P1M+yO9RsMlwxeQWLyulusrmln84gA1zZ9U=; b=udUvafzBN/IxqTK4plXiOaRW86 yeKXL7McPk4pvMSc3bsGzFhz5MYN36rT4B/7u1Xm4U/jXyMKAjAzoe5wzKsyewQfA2QLrHxj2gIS+ RuGAVruj7zbuQ7797CCC3IhiUAFySYwySGy9uvz8DQYIlfEdRGal2m095Ujn68ahMHCCUGwr8F2mX CiSNZtDG7RHZFHKcmivAlWTDhLo+qvszPyWYG6LW5WUizQjrbt+2tpOUDNZcuXxrZdaYH850Snlri NqFXqsYC6HdnJDqcpj6YlhUtomEUVpcJBkkITA7e6sbyrhW5i5Zg0ryXN0YwAP61h/X4Ow/Z8Uykk 50dfKC4Q==; Received: from [2001:4bb8:2d1:6fdb:d67d:128c:34ba:85b8] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wOqNX-0000000EFhF-3dRL; Mon, 18 May 2026 05:19:01 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Huacai Chen , WANG Xuerui , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Herbert Xu , Dan Williams , Chris Mason , David Sterba , Arnd Bergmann , Song Liu , Yu Kuai , Li Nan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-arch@vger.kernel.org, linux-raid@vger.kernel.org Subject: [PATCH 03/18] raid6: move to lib/raid/ Date: Mon, 18 May 2026 07:17:46 +0200 Message-ID: <20260518051804.462141-4-hch@lst.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260518051804.462141-1-hch@lst.de> References: <20260518051804.462141-1-hch@lst.de> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Move the raid6 code to live in lib/raid/ with the XOR code, and change the internal organization so that each architecture has a subdirectory similar to the CRC, crypto and XOR libraries, and fix up the Makefile to only build files actually needed. Also move the kunit test case from the history test/ subdirectory to tests/ and use the normal naming scheme for it. Signed-off-by: Christoph Hellwig Acked-by: Ard Biesheuvel Tested-by: Ard Biesheuvel # kunit only on arm64 --- MAINTAINERS | 2 +- lib/Kconfig | 22 ---- lib/Makefile | 1 - lib/raid/Kconfig | 22 ++++ lib/raid/Makefile | 2 +- lib/{ => raid}/raid6/.gitignore | 0 lib/raid/raid6/Makefile | 122 ++++++++++++++++++ lib/{ => raid}/raid6/algos.c | 0 lib/{raid6 => raid/raid6/arm}/neon.c | 0 lib/{raid6 => raid/raid6/arm}/neon.h | 0 lib/{raid6 => raid/raid6/arm}/neon.uc | 2 +- lib/{raid6 => raid/raid6/arm}/recov_neon.c | 2 +- .../raid6/arm}/recov_neon_inner.c | 2 +- lib/{ => raid}/raid6/int.uc | 0 .../raid6/loongarch}/loongarch_simd.c | 0 .../raid6/loongarch}/recov_loongarch_simd.c | 0 lib/{ => raid}/raid6/mktables.c | 0 lib/{raid6 => raid/raid6/powerpc}/altivec.uc | 4 - lib/{raid6 => raid/raid6/powerpc}/vpermxor.uc | 3 - lib/{ => raid}/raid6/recov.c | 0 lib/{raid6 => raid/raid6/riscv}/recov_rvv.c | 0 lib/{raid6 => raid/raid6/riscv}/rvv.c | 0 lib/{raid6 => raid/raid6/riscv}/rvv.h | 0 lib/{raid6 => raid/raid6/s390}/recov_s390xc.c | 0 lib/{raid6 => raid/raid6/s390}/s390vx.uc | 0 lib/{raid6/test => raid/raid6/tests}/Makefile | 2 - .../test.c => raid/raid6/tests/raid6_kunit.c} | 0 lib/{ => raid}/raid6/unroll.awk | 0 lib/{raid6 => raid/raid6/x86}/avx2.c | 0 lib/{raid6 => raid/raid6/x86}/avx512.c | 0 lib/{raid6 => raid/raid6/x86}/mmx.c | 4 - lib/{raid6 => raid/raid6/x86}/recov_avx2.c | 0 lib/{raid6 => raid/raid6/x86}/recov_avx512.c | 0 lib/{raid6 => raid/raid6/x86}/recov_ssse3.c | 0 lib/{raid6 => raid/raid6/x86}/sse1.c | 4 - lib/{raid6 => raid/raid6/x86}/sse2.c | 0 lib/raid6/Makefile | 83 ------------ lib/raid6/test/.gitignore | 3 - 38 files changed, 149 insertions(+), 131 deletions(-) rename lib/{ => raid}/raid6/.gitignore (100%) create mode 100644 lib/raid/raid6/Makefile rename lib/{ => raid}/raid6/algos.c (100%) rename lib/{raid6 => raid/raid6/arm}/neon.c (100%) rename lib/{raid6 => raid/raid6/arm}/neon.h (100%) rename lib/{raid6 => raid/raid6/arm}/neon.uc (99%) rename lib/{raid6 => raid/raid6/arm}/recov_neon.c (99%) rename lib/{raid6 => raid/raid6/arm}/recov_neon_inner.c (99%) rename lib/{ => raid}/raid6/int.uc (100%) rename lib/{raid6 => raid/raid6/loongarch}/loongarch_simd.c (100%) rename lib/{raid6 => raid/raid6/loongarch}/recov_loongarch_simd.c (100%) rename lib/{ => raid}/raid6/mktables.c (100%) rename lib/{raid6 => raid/raid6/powerpc}/altivec.uc (98%) rename lib/{raid6 => raid/raid6/powerpc}/vpermxor.uc (98%) rename lib/{ => raid}/raid6/recov.c (100%) rename lib/{raid6 => raid/raid6/riscv}/recov_rvv.c (100%) rename lib/{raid6 => raid/raid6/riscv}/rvv.c (100%) rename lib/{raid6 => raid/raid6/riscv}/rvv.h (100%) rename lib/{raid6 => raid/raid6/s390}/recov_s390xc.c (100%) rename lib/{raid6 => raid/raid6/s390}/s390vx.uc (100%) rename lib/{raid6/test => raid/raid6/tests}/Makefile (77%) rename lib/{raid6/test/test.c => raid/raid6/tests/raid6_kunit.c} (100%) rename lib/{ => raid}/raid6/unroll.awk (100%) rename lib/{raid6 => raid/raid6/x86}/avx2.c (100%) rename lib/{raid6 => raid/raid6/x86}/avx512.c (100%) rename lib/{raid6 => raid/raid6/x86}/mmx.c (99%) rename lib/{raid6 => raid/raid6/x86}/recov_avx2.c (100%) rename lib/{raid6 => raid/raid6/x86}/recov_avx512.c (100%) rename lib/{raid6 => raid/raid6/x86}/recov_ssse3.c (100%) rename lib/{raid6 => raid/raid6/x86}/sse1.c (99%) rename lib/{raid6 => raid/raid6/x86}/sse2.c (100%) delete mode 100644 lib/raid6/Makefile delete mode 100644 lib/raid6/test/.gitignore diff --git a/MAINTAINERS b/MAINTAINERS index c2c6d79275c6..e6f778339a3f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24821,7 +24821,7 @@ F: drivers/md/md* F: drivers/md/raid* F: include/linux/raid/ F: include/uapi/linux/raid/ -F: lib/raid6/ +F: lib/raid/raid6/ SOLIDRUN CLEARFOG SUPPORT M: Russell King diff --git a/lib/Kconfig b/lib/Kconfig index bffe015a6c10..b87f954a14bc 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -8,28 +8,6 @@ config BINARY_PRINTF menu "Library routines" -config RAID6_PQ - tristate - -config RAID6_PQ_KUNIT_TEST - tristate "KUnit tests for RAID6 PQ functions" if !KUNIT_ALL_TESTS - depends on KUNIT - depends on RAID6_PQ - default KUNIT_ALL_TESTS - help - Unit tests for the RAID6 PQ library functions. - - This is intended to help people writing architecture-specific - optimized versions. If unsure, say N. - -config RAID6_PQ_BENCHMARK - bool "Automatically choose fastest RAID6 PQ functions" - depends on RAID6_PQ - default y - help - Benchmark all available RAID6 PQ functions on init and choose the - fastest one. - config LINEAR_RANGES tristate diff --git a/lib/Makefile b/lib/Makefile index f33a24bf1c19..6e72d2c1cce7 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -167,7 +167,6 @@ obj-$(CONFIG_LZ4_DECOMPRESS) += lz4/ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/ obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/ obj-$(CONFIG_XZ_DEC) += xz/ -obj-$(CONFIG_RAID6_PQ) += raid6/ lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o diff --git a/lib/raid/Kconfig b/lib/raid/Kconfig index 5ab2b0a7be4c..e39f6d667792 100644 --- a/lib/raid/Kconfig +++ b/lib/raid/Kconfig @@ -28,3 +28,25 @@ config XOR_KUNIT_TEST This is intended to help people writing architecture-specific optimized versions. If unsure, say N. + +config RAID6_PQ + tristate + +config RAID6_PQ_KUNIT_TEST + tristate "KUnit tests for RAID6 PQ functions" if !KUNIT_ALL_TESTS + depends on KUNIT + depends on RAID6_PQ + default KUNIT_ALL_TESTS + help + Unit tests for the RAID6 PQ library functions. + + This is intended to help people writing architecture-specific + optimized versions. If unsure, say N. + +config RAID6_PQ_BENCHMARK + bool "Automatically choose fastest RAID6 PQ functions" + depends on RAID6_PQ + default y + help + Benchmark all available RAID6 PQ functions on init and choose the + fastest one. diff --git a/lib/raid/Makefile b/lib/raid/Makefile index 3540fe846dc4..6fc5eeb53df0 100644 --- a/lib/raid/Makefile +++ b/lib/raid/Makefile @@ -1,3 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y += xor/ +obj-y += xor/ raid6/ diff --git a/lib/raid6/.gitignore b/lib/raid/raid6/.gitignore similarity index 100% rename from lib/raid6/.gitignore rename to lib/raid/raid6/.gitignore diff --git a/lib/raid/raid6/Makefile b/lib/raid/raid6/Makefile new file mode 100644 index 000000000000..7cb31b8a5c17 --- /dev/null +++ b/lib/raid/raid6/Makefile @@ -0,0 +1,122 @@ +# SPDX-License-Identifier: GPL-2.0 + +ccflags-y += -I $(src) + +obj-$(CONFIG_RAID6_PQ) += raid6_pq.o tests/ + +raid6_pq-y += algos.o tables.o + +# generic integer generation and recovery implementation +raid6_pq-y += int1.o int2.o int4.o int8.o +raid6_pq-y += recov.o + +# architecture-specific generation and recovery implementations: +raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += arm/neon.o \ + arm/neon1.o \ + arm/neon2.o \ + arm/neon4.o \ + arm/neon8.o \ + arm/recov_neon.o \ + arm/recov_neon_inner.o +raid6_pq-$(CONFIG_LOONGARCH) += loongarch/loongarch_simd.o \ + loongarch/recov_loongarch_simd.o +raid6_pq-$(CONFIG_ALTIVEC) += powerpc/altivec1.o \ + powerpc/altivec2.o \ + powerpc/altivec4.o \ + powerpc/altivec8.o \ + powerpc/vpermxor1.o \ + powerpc/vpermxor2.o \ + powerpc/vpermxor4.o \ + powerpc/vpermxor8.o +raid6_pq-$(CONFIG_RISCV_ISA_V) += riscv/rvv.o \ + riscv/recov_rvv.o +raid6_pq-$(CONFIG_S390) += s390/s390vx8.o \ + s390/recov_s390xc.o +ifeq ($(CONFIG_X86),y) +raid6_pq-$(CONFIG_X86_32) += x86/mmx.o \ + x86/sse1.o +endif +raid6_pq-$(CONFIG_X86) += x86/sse2.o \ + x86/avx2.o \ + x86/avx512.o \ + x86/recov_ssse3.o \ + x86/recov_avx2.o \ + x86/recov_avx512.o + +hostprogs += mktables + +CFLAGS_arm/neon1.o += $(CC_FLAGS_FPU) +CFLAGS_arm/neon2.o += $(CC_FLAGS_FPU) +CFLAGS_arm/neon4.o += $(CC_FLAGS_FPU) +CFLAGS_arm/neon8.o += $(CC_FLAGS_FPU) +CFLAGS_arm/recov_neon_inner.o += $(CC_FLAGS_FPU) +CFLAGS_REMOVE_arm/neon1.o += $(CC_FLAGS_NO_FPU) +CFLAGS_REMOVE_arm/neon2.o += $(CC_FLAGS_NO_FPU) +CFLAGS_REMOVE_arm/neon4.o += $(CC_FLAGS_NO_FPU) +CFLAGS_REMOVE_arm/neon8.o += $(CC_FLAGS_NO_FPU) +CFLAGS_REMOVE_arm/recov_neon_inner.o += $(CC_FLAGS_NO_FPU) + +ifeq ($(CONFIG_ALTIVEC),y) +altivec_flags := -maltivec $(call cc-option,-mabi=altivec) +# Enable +altivec_flags += -isystem $(shell $(CC) -print-file-name=include) + +CFLAGS_powerpc/altivec1.o += $(altivec_flags) +CFLAGS_powerpc/altivec2.o += $(altivec_flags) +CFLAGS_powerpc/altivec4.o += $(altivec_flags) +CFLAGS_powerpc/altivec8.o += $(altivec_flags) +CFLAGS_powerpc/vpermxor1.o += $(altivec_flags) +CFLAGS_powerpc/vpermxor2.o += $(altivec_flags) +CFLAGS_powerpc/vpermxor4.o += $(altivec_flags) +CFLAGS_powerpc/vpermxor8.o += $(altivec_flags) + +ifdef CONFIG_CC_IS_CLANG +# clang ppc port does not yet support -maltivec when -msoft-float is +# enabled. A future release of clang will resolve this +# https://llvm.org/pr31177 +CFLAGS_REMOVE_powerpc/altivec1.o += -msoft-float +CFLAGS_REMOVE_powerpc/altivec2.o += -msoft-float +CFLAGS_REMOVE_powerpc/altivec4.o += -msoft-float +CFLAGS_REMOVE_powerpc/altivec8.o += -msoft-float +CFLAGS_REMOVE_powerpc/vpermxor1.o += -msoft-float +CFLAGS_REMOVE_powerpc/vpermxor2.o += -msoft-float +CFLAGS_REMOVE_powerpc/vpermxor4.o += -msoft-float +CFLAGS_REMOVE_powerpc/vpermxor8.o += -msoft-float +endif # CONFIG_CC_IS_CLANG +endif # CONFIG_ALTIVEC + +quiet_cmd_mktable = TABLE $@ + cmd_mktable = $(obj)/mktables > $@ + +targets += tables.c +$(obj)/tables.c: $(obj)/mktables FORCE + $(call if_changed,mktable) + +quiet_cmd_unroll = UNROLL $@ + cmd_unroll = $(AWK) -v N=$* -f $(src)/unroll.awk < $< > $@ + +targets += int1.c int2.c int4.c int8.c +$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE + $(call if_changed,unroll) + +targets += arm/neon1.c arm/neon2.c arm/neon4.c arm/neon8.c +$(obj)/arm/neon%.c: $(src)/arm/neon.uc $(src)/unroll.awk FORCE + $(call if_changed,unroll) + +targets += powerpc/altivec1.c \ + powerpc/altivec2.c \ + powerpc/altivec4.c \ + powerpc/altivec8.c +$(obj)/powerpc/altivec%.c: $(src)/powerpc/altivec.uc $(src)/unroll.awk FORCE + $(call if_changed,unroll) + +targets += powerpc/vpermxor1.c \ + powerpc/vpermxor2.c \ + powerpc/vpermxor4.c \ + powerpc/vpermxor8.c +$(obj)/powerpc/vpermxor%.c: $(src)/powerpc/vpermxor.uc $(src)/unroll.awk FORCE + $(call if_changed,unroll) + +targets += s390/s390vx8.c +$(obj)/s390/s390vx%.c: $(src)/s390/s390vx.uc $(src)/unroll.awk FORCE + $(call if_changed,unroll) diff --git a/lib/raid6/algos.c b/lib/raid/raid6/algos.c similarity index 100% rename from lib/raid6/algos.c rename to lib/raid/raid6/algos.c diff --git a/lib/raid6/neon.c b/lib/raid/raid6/arm/neon.c similarity index 100% rename from lib/raid6/neon.c rename to lib/raid/raid6/arm/neon.c diff --git a/lib/raid6/neon.h b/lib/raid/raid6/arm/neon.h similarity index 100% rename from lib/raid6/neon.h rename to lib/raid/raid6/arm/neon.h diff --git a/lib/raid6/neon.uc b/lib/raid/raid6/arm/neon.uc similarity index 99% rename from lib/raid6/neon.uc rename to lib/raid/raid6/arm/neon.uc index 355270af0cd6..14a9fc2c60fa 100644 --- a/lib/raid6/neon.uc +++ b/lib/raid/raid6/arm/neon.uc @@ -25,7 +25,7 @@ */ #include -#include "neon.h" +#include "arm/neon.h" typedef uint8x16_t unative_t; diff --git a/lib/raid6/recov_neon.c b/lib/raid/raid6/arm/recov_neon.c similarity index 99% rename from lib/raid6/recov_neon.c rename to lib/raid/raid6/arm/recov_neon.c index 13d5df718c15..5a48fcc762e8 100644 --- a/lib/raid6/recov_neon.c +++ b/lib/raid/raid6/arm/recov_neon.c @@ -6,7 +6,7 @@ #include #include -#include "neon.h" +#include "arm/neon.h" static int raid6_has_neon(void) { diff --git a/lib/raid6/recov_neon_inner.c b/lib/raid/raid6/arm/recov_neon_inner.c similarity index 99% rename from lib/raid6/recov_neon_inner.c rename to lib/raid/raid6/arm/recov_neon_inner.c index f9e7e8f5a151..53c355efa7ff 100644 --- a/lib/raid6/recov_neon_inner.c +++ b/lib/raid/raid6/arm/recov_neon_inner.c @@ -5,7 +5,7 @@ */ #include -#include "neon.h" +#include "arm/neon.h" #ifdef CONFIG_ARM /* diff --git a/lib/raid6/int.uc b/lib/raid/raid6/int.uc similarity index 100% rename from lib/raid6/int.uc rename to lib/raid/raid6/int.uc diff --git a/lib/raid6/loongarch_simd.c b/lib/raid/raid6/loongarch/loongarch_simd.c similarity index 100% rename from lib/raid6/loongarch_simd.c rename to lib/raid/raid6/loongarch/loongarch_simd.c diff --git a/lib/raid6/recov_loongarch_simd.c b/lib/raid/raid6/loongarch/recov_loongarch_simd.c similarity index 100% rename from lib/raid6/recov_loongarch_simd.c rename to lib/raid/raid6/loongarch/recov_loongarch_simd.c diff --git a/lib/raid6/mktables.c b/lib/raid/raid6/mktables.c similarity index 100% rename from lib/raid6/mktables.c rename to lib/raid/raid6/mktables.c diff --git a/lib/raid6/altivec.uc b/lib/raid/raid6/powerpc/altivec.uc similarity index 98% rename from lib/raid6/altivec.uc rename to lib/raid/raid6/powerpc/altivec.uc index 2c59963e58f9..130d3d3dd42c 100644 --- a/lib/raid6/altivec.uc +++ b/lib/raid/raid6/powerpc/altivec.uc @@ -24,8 +24,6 @@ #include -#ifdef CONFIG_ALTIVEC - #include #include #include @@ -122,5 +120,3 @@ const struct raid6_calls raid6_altivec$# = { "altivecx$#", 0 }; - -#endif /* CONFIG_ALTIVEC */ diff --git a/lib/raid6/vpermxor.uc b/lib/raid/raid6/powerpc/vpermxor.uc similarity index 98% rename from lib/raid6/vpermxor.uc rename to lib/raid/raid6/powerpc/vpermxor.uc index a8e76b1c956e..595f20aaf4cf 100644 --- a/lib/raid6/vpermxor.uc +++ b/lib/raid/raid6/powerpc/vpermxor.uc @@ -21,8 +21,6 @@ */ #include -#ifdef CONFIG_ALTIVEC - #include #include #include @@ -95,4 +93,3 @@ const struct raid6_calls raid6_vpermxor$# = { "vpermxor$#", 0 }; -#endif diff --git a/lib/raid6/recov.c b/lib/raid/raid6/recov.c similarity index 100% rename from lib/raid6/recov.c rename to lib/raid/raid6/recov.c diff --git a/lib/raid6/recov_rvv.c b/lib/raid/raid6/riscv/recov_rvv.c similarity index 100% rename from lib/raid6/recov_rvv.c rename to lib/raid/raid6/riscv/recov_rvv.c diff --git a/lib/raid6/rvv.c b/lib/raid/raid6/riscv/rvv.c similarity index 100% rename from lib/raid6/rvv.c rename to lib/raid/raid6/riscv/rvv.c diff --git a/lib/raid6/rvv.h b/lib/raid/raid6/riscv/rvv.h similarity index 100% rename from lib/raid6/rvv.h rename to lib/raid/raid6/riscv/rvv.h diff --git a/lib/raid6/recov_s390xc.c b/lib/raid/raid6/s390/recov_s390xc.c similarity index 100% rename from lib/raid6/recov_s390xc.c rename to lib/raid/raid6/s390/recov_s390xc.c diff --git a/lib/raid6/s390vx.uc b/lib/raid/raid6/s390/s390vx.uc similarity index 100% rename from lib/raid6/s390vx.uc rename to lib/raid/raid6/s390/s390vx.uc diff --git a/lib/raid6/test/Makefile b/lib/raid/raid6/tests/Makefile similarity index 77% rename from lib/raid6/test/Makefile rename to lib/raid/raid6/tests/Makefile index 520381ea71d7..87a001b22847 100644 --- a/lib/raid6/test/Makefile +++ b/lib/raid/raid6/tests/Makefile @@ -1,5 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_RAID6_PQ_KUNIT_TEST) += raid6_kunit.o - -raid6_kunit-y += test.o diff --git a/lib/raid6/test/test.c b/lib/raid/raid6/tests/raid6_kunit.c similarity index 100% rename from lib/raid6/test/test.c rename to lib/raid/raid6/tests/raid6_kunit.c diff --git a/lib/raid6/unroll.awk b/lib/raid/raid6/unroll.awk similarity index 100% rename from lib/raid6/unroll.awk rename to lib/raid/raid6/unroll.awk diff --git a/lib/raid6/avx2.c b/lib/raid/raid6/x86/avx2.c similarity index 100% rename from lib/raid6/avx2.c rename to lib/raid/raid6/x86/avx2.c diff --git a/lib/raid6/avx512.c b/lib/raid/raid6/x86/avx512.c similarity index 100% rename from lib/raid6/avx512.c rename to lib/raid/raid6/x86/avx512.c diff --git a/lib/raid6/mmx.c b/lib/raid/raid6/x86/mmx.c similarity index 99% rename from lib/raid6/mmx.c rename to lib/raid/raid6/x86/mmx.c index e411f0cfbd95..7e9810669347 100644 --- a/lib/raid6/mmx.c +++ b/lib/raid/raid6/x86/mmx.c @@ -11,8 +11,6 @@ * MMX implementation of RAID-6 syndrome functions */ -#ifdef CONFIG_X86_32 - #include #include @@ -135,5 +133,3 @@ const struct raid6_calls raid6_mmxx2 = { "mmxx2", 0 }; - -#endif diff --git a/lib/raid6/recov_avx2.c b/lib/raid/raid6/x86/recov_avx2.c similarity index 100% rename from lib/raid6/recov_avx2.c rename to lib/raid/raid6/x86/recov_avx2.c diff --git a/lib/raid6/recov_avx512.c b/lib/raid/raid6/x86/recov_avx512.c similarity index 100% rename from lib/raid6/recov_avx512.c rename to lib/raid/raid6/x86/recov_avx512.c diff --git a/lib/raid6/recov_ssse3.c b/lib/raid/raid6/x86/recov_ssse3.c similarity index 100% rename from lib/raid6/recov_ssse3.c rename to lib/raid/raid6/x86/recov_ssse3.c diff --git a/lib/raid6/sse1.c b/lib/raid/raid6/x86/sse1.c similarity index 99% rename from lib/raid6/sse1.c rename to lib/raid/raid6/x86/sse1.c index 794d5cfa0306..deecdd72ceec 100644 --- a/lib/raid6/sse1.c +++ b/lib/raid/raid6/x86/sse1.c @@ -16,8 +16,6 @@ * worthwhile as a separate implementation. */ -#ifdef CONFIG_X86_32 - #include #include @@ -155,5 +153,3 @@ const struct raid6_calls raid6_sse1x2 = { "sse1x2", 1 /* Has cache hints */ }; - -#endif diff --git a/lib/raid6/sse2.c b/lib/raid/raid6/x86/sse2.c similarity index 100% rename from lib/raid6/sse2.c rename to lib/raid/raid6/x86/sse2.c diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile deleted file mode 100644 index 6fd048c127b6..000000000000 --- a/lib/raid6/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_RAID6_PQ) += raid6_pq.o test/ - -raid6_pq-y += algos.o recov.o tables.o int1.o int2.o int4.o \ - int8.o - -raid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o avx512.o recov_avx512.o -raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o \ - vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o -raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o -raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o -raid6_pq-$(CONFIG_LOONGARCH) += loongarch_simd.o recov_loongarch_simd.o -raid6_pq-$(CONFIG_RISCV_ISA_V) += rvv.o recov_rvv.o - -hostprogs += mktables - -ifeq ($(CONFIG_ALTIVEC),y) -altivec_flags := -maltivec $(call cc-option,-mabi=altivec) -# Enable -altivec_flags += -isystem $(shell $(CC) -print-file-name=include) - -ifdef CONFIG_CC_IS_CLANG -# clang ppc port does not yet support -maltivec when -msoft-float is -# enabled. A future release of clang will resolve this -# https://llvm.org/pr31177 -CFLAGS_REMOVE_altivec1.o += -msoft-float -CFLAGS_REMOVE_altivec2.o += -msoft-float -CFLAGS_REMOVE_altivec4.o += -msoft-float -CFLAGS_REMOVE_altivec8.o += -msoft-float -CFLAGS_REMOVE_vpermxor1.o += -msoft-float -CFLAGS_REMOVE_vpermxor2.o += -msoft-float -CFLAGS_REMOVE_vpermxor4.o += -msoft-float -CFLAGS_REMOVE_vpermxor8.o += -msoft-float -endif -endif - -quiet_cmd_unroll = UNROLL $@ - cmd_unroll = $(AWK) -v N=$* -f $(src)/unroll.awk < $< > $@ - -targets += int1.c int2.c int4.c int8.c -$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE - $(call if_changed,unroll) - -CFLAGS_altivec1.o += $(altivec_flags) -CFLAGS_altivec2.o += $(altivec_flags) -CFLAGS_altivec4.o += $(altivec_flags) -CFLAGS_altivec8.o += $(altivec_flags) -targets += altivec1.c altivec2.c altivec4.c altivec8.c -$(obj)/altivec%.c: $(src)/altivec.uc $(src)/unroll.awk FORCE - $(call if_changed,unroll) - -CFLAGS_vpermxor1.o += $(altivec_flags) -CFLAGS_vpermxor2.o += $(altivec_flags) -CFLAGS_vpermxor4.o += $(altivec_flags) -CFLAGS_vpermxor8.o += $(altivec_flags) -targets += vpermxor1.c vpermxor2.c vpermxor4.c vpermxor8.c -$(obj)/vpermxor%.c: $(src)/vpermxor.uc $(src)/unroll.awk FORCE - $(call if_changed,unroll) - -CFLAGS_neon1.o += $(CC_FLAGS_FPU) -CFLAGS_neon2.o += $(CC_FLAGS_FPU) -CFLAGS_neon4.o += $(CC_FLAGS_FPU) -CFLAGS_neon8.o += $(CC_FLAGS_FPU) -CFLAGS_recov_neon_inner.o += $(CC_FLAGS_FPU) -CFLAGS_REMOVE_neon1.o += $(CC_FLAGS_NO_FPU) -CFLAGS_REMOVE_neon2.o += $(CC_FLAGS_NO_FPU) -CFLAGS_REMOVE_neon4.o += $(CC_FLAGS_NO_FPU) -CFLAGS_REMOVE_neon8.o += $(CC_FLAGS_NO_FPU) -CFLAGS_REMOVE_recov_neon_inner.o += $(CC_FLAGS_NO_FPU) -targets += neon1.c neon2.c neon4.c neon8.c -$(obj)/neon%.c: $(src)/neon.uc $(src)/unroll.awk FORCE - $(call if_changed,unroll) - -targets += s390vx8.c -$(obj)/s390vx%.c: $(src)/s390vx.uc $(src)/unroll.awk FORCE - $(call if_changed,unroll) - -quiet_cmd_mktable = TABLE $@ - cmd_mktable = $(obj)/mktables > $@ - -targets += tables.c -$(obj)/tables.c: $(obj)/mktables FORCE - $(call if_changed,mktable) diff --git a/lib/raid6/test/.gitignore b/lib/raid6/test/.gitignore deleted file mode 100644 index 1b68a77f348f..000000000000 --- a/lib/raid6/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/int.uc -/neon.uc -/raid6test -- 2.53.0