get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2216731/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2216731,
    "url": "http://patchwork.ozlabs.org/api/patches/2216731/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/20260327061704.3707577-22-hch@lst.de/",
    "project": {
        "id": 60,
        "url": "http://patchwork.ozlabs.org/api/projects/60/?format=api",
        "name": "User-mode Linux Development",
        "link_name": "linux-um",
        "list_id": "linux-um.lists.infradead.org",
        "list_email": "linux-um@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260327061704.3707577-22-hch@lst.de>",
    "list_archive_url": null,
    "date": "2026-03-27T06:16:53",
    "name": "[21/28] xor: make xor.ko self-contained in lib/raid/",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "dc4b0942be5987bba40f51f1417a28c82b4a8ee8",
    "submitter": {
        "id": 82,
        "url": "http://patchwork.ozlabs.org/api/people/82/?format=api",
        "name": "Christoph Hellwig",
        "email": "hch@lst.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/20260327061704.3707577-22-hch@lst.de/mbox/",
    "series": [
        {
            "id": 497692,
            "url": "http://patchwork.ozlabs.org/api/series/497692/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=497692",
            "date": "2026-03-27T06:16:33",
            "name": "[01/28] xor: assert that xor_blocks is not call from interrupt context",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497692/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216731/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216731/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=JrrkBntH;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhrCf4KhJz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 17:22:22 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w60aK-00000006nZ8-4BQ1;\n\tFri, 27 Mar 2026 06:22:21 +0000",
            "from\n 2a02-8389-2341-5b80-d601-7564-c2e0-491c.cable.dynamic.v6.surfer.at\n ([2a02:8389:2341:5b80:d601:7564:c2e0:491c] helo=localhost)\n\tby bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w60aH-00000006nPG-15NE;\n\tFri, 27 Mar 2026 06:22:17 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help\n\t:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding:\n\tMIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:\n\tReply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;\n\tbh=kGB12FsjrPNedpZLlnKEpALQH6AOTzK6HiV2Z1pgiSc=; b=JrrkBntHlswVJCxqGQ/s1dfbMC\n\tJ6MCX/sDt+nHNkoO8up61QSAW8cUPKksOdbXV9Lt2qP8nex3esNuL7Grpc6vpyAK3ymKTZep161i4\n\tgM7i2ZgULQCjlH/p8pibg7y3bvF/xPNWQgOUX7XvhkrJanMz9WoUMhZ26mzQLPZBnaUuUMrh1bjMp\n\tMvWBtdY0qbXRX2m/kDCtVdP0cysi27+eilG5k6bxTfZKfAzBF1iL3uflXgJoC8O0gVaVVQNre/W2e\n\t6vfGGQaJim6jkWBQcn5tEonmu2QScbSzbZyEtv4/qO4//vYzZ4w6+mpiRoeuY1bCj5bVyFjpa3qmu\n\tCVp9ubKw==;",
        "From": "Christoph Hellwig <hch@lst.de>",
        "To": "Andrew Morton <akpm@linux-foundation.org>",
        "Cc": "Richard Henderson <richard.henderson@linaro.org>,\n\tMatt Turner <mattst88@gmail.com>,\n\tMagnus Lindholm <linmag7@gmail.com>,\n\tRussell King <linux@armlinux.org.uk>,\n\tCatalin Marinas <catalin.marinas@arm.com>,\n\tWill Deacon <will@kernel.org>,\n\tArd Biesheuvel <ardb@kernel.org>,\n\tHuacai Chen <chenhuacai@kernel.org>,\n\tWANG Xuerui <kernel@xen0n.name>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\t\"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n\tPaul Walmsley <pjw@kernel.org>,\n\tPalmer Dabbelt <palmer@dabbelt.com>,\n\tAlbert Ou <aou@eecs.berkeley.edu>,\n\tAlexandre Ghiti <alex@ghiti.fr>,\n\tHeiko Carstens <hca@linux.ibm.com>,\n\tVasily Gorbik <gor@linux.ibm.com>,\n\tAlexander Gordeev <agordeev@linux.ibm.com>,\n\tChristian Borntraeger <borntraeger@linux.ibm.com>,\n\tSven Schnelle <svens@linux.ibm.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tAndreas Larsson <andreas@gaisler.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tAnton Ivanov <anton.ivanov@cambridgegreys.com>,\n\tJohannes Berg <johannes@sipsolutions.net>,\n\tThomas Gleixner <tglx@kernel.org>,\n\tIngo Molnar <mingo@redhat.com>,\n\tBorislav Petkov <bp@alien8.de>,\n\tDave Hansen <dave.hansen@linux.intel.com>,\n\tx86@kernel.org,\n\t\"H. Peter Anvin\" <hpa@zytor.com>,\n\tHerbert Xu <herbert@gondor.apana.org.au>,\n\tDan Williams <dan.j.williams@intel.com>,\n\tChris Mason <clm@fb.com>,\n\tDavid Sterba <dsterba@suse.com>,\n\tArnd Bergmann <arnd@arndb.de>,\n\tSong Liu <song@kernel.org>,\n\tYu Kuai <yukuai@fnnas.com>,\n\tLi Nan <linan122@huawei.com>,\n\t\"Theodore Ts'o\" <tytso@mit.edu>,\n\t\"Jason A. Donenfeld\" <Jason@zx2c4.com>,\n\tlinux-alpha@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tloongarch@lists.linux.dev,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-s390@vger.kernel.org,\n\tsparclinux@vger.kernel.org,\n\tlinux-um@lists.infradead.org,\n\tlinux-crypto@vger.kernel.org,\n\tlinux-btrfs@vger.kernel.org,\n\tlinux-arch@vger.kernel.org,\n\tlinux-raid@vger.kernel.org",
        "Subject": "[PATCH 21/28] xor: make xor.ko self-contained in lib/raid/",
        "Date": "Fri, 27 Mar 2026 07:16:53 +0100",
        "Message-ID": "<20260327061704.3707577-22-hch@lst.de>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<20260327061704.3707577-1-hch@lst.de>",
        "References": "<20260327061704.3707577-1-hch@lst.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "linux-um@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<linux-um.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>",
        "List-Post": "<mailto:linux-um@lists.infradead.org>",
        "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>",
        "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>",
        "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Move the asm/xor.h headers to lib/raid/xor/$(SRCARCH)/xor_arch.h and\ninclude/linux/raid/xor_impl.h to lib/raid/xor/xor_impl.h so that the\nxor.ko module implementation is self-contained in lib/raid/.\n\nAs this remove the asm-generic mechanism a new kconfig symbol is\nadded to indicate that a architecture-specific implementations\nexists, and xor_arch.h should be included.\n\nSigned-off-by: Christoph Hellwig <hch@lst.de>\n---\n arch/um/include/asm/xor.h                      |  8 --------\n include/asm-generic/Kbuild                     |  1 -\n include/asm-generic/xor.h                      | 11 -----------\n lib/raid/Kconfig                               | 15 +++++++++++++++\n lib/raid/xor/Makefile                          |  6 ++++++\n lib/raid/xor/alpha/xor.c                       |  4 ++--\n .../asm/xor.h => lib/raid/xor/alpha/xor_arch.h |  2 --\n lib/raid/xor/arm/xor-neon-glue.c               |  4 ++--\n lib/raid/xor/arm/xor-neon.c                    |  2 +-\n lib/raid/xor/arm/xor.c                         |  4 ++--\n .../asm/xor.h => lib/raid/xor/arm/xor_arch.h   |  2 --\n lib/raid/xor/arm64/xor-neon-glue.c             |  4 ++--\n lib/raid/xor/arm64/xor-neon.c                  |  4 ++--\n .../asm/xor.h => lib/raid/xor/arm64/xor_arch.h |  3 ---\n .../xor.h => lib/raid/xor/loongarch/xor_arch.h |  7 -------\n lib/raid/xor/loongarch/xor_simd_glue.c         |  4 ++--\n .../xor.h => lib/raid/xor/powerpc/xor_arch.h   |  7 -------\n lib/raid/xor/powerpc/xor_vmx_glue.c            |  4 ++--\n lib/raid/xor/riscv/xor-glue.c                  |  4 ++--\n .../asm/xor.h => lib/raid/xor/riscv/xor_arch.h |  2 --\n lib/raid/xor/s390/xor.c                        |  4 ++--\n .../asm/xor.h => lib/raid/xor/s390/xor_arch.h  |  6 ------\n lib/raid/xor/sparc/xor-sparc32.c               |  4 ++--\n lib/raid/xor/sparc/xor-sparc64-glue.c          |  4 ++--\n .../asm/xor.h => lib/raid/xor/sparc/xor_arch.h |  9 ---------\n lib/raid/xor/um/xor_arch.h                     |  2 ++\n lib/raid/xor/x86/xor-avx.c                     |  4 ++--\n lib/raid/xor/x86/xor-mmx.c                     |  4 ++--\n lib/raid/xor/x86/xor-sse.c                     |  4 ++--\n .../asm/xor.h => lib/raid/xor/x86/xor_arch.h   |  7 -------\n lib/raid/xor/xor-32regs-prefetch.c             |  3 +--\n lib/raid/xor/xor-32regs.c                      |  3 +--\n lib/raid/xor/xor-8regs-prefetch.c              |  3 +--\n lib/raid/xor/xor-8regs.c                       |  3 +--\n lib/raid/xor/xor-core.c                        | 18 +++++++++++-------\n .../linux/raid => lib/raid/xor}/xor_impl.h     |  6 ++++++\n 36 files changed, 73 insertions(+), 109 deletions(-)\n delete mode 100644 arch/um/include/asm/xor.h\n delete mode 100644 include/asm-generic/xor.h\n rename arch/alpha/include/asm/xor.h => lib/raid/xor/alpha/xor_arch.h (90%)\n rename arch/arm/include/asm/xor.h => lib/raid/xor/arm/xor_arch.h (87%)\n rename arch/arm64/include/asm/xor.h => lib/raid/xor/arm64/xor_arch.h (89%)\n rename arch/loongarch/include/asm/xor.h => lib/raid/xor/loongarch/xor_arch.h (85%)\n rename arch/powerpc/include/asm/xor.h => lib/raid/xor/powerpc/xor_arch.h (77%)\n rename arch/riscv/include/asm/xor.h => lib/raid/xor/riscv/xor_arch.h (84%)\n rename arch/s390/include/asm/xor.h => lib/raid/xor/s390/xor_arch.h (71%)\n rename arch/sparc/include/asm/xor.h => lib/raid/xor/sparc/xor_arch.h (81%)\n create mode 100644 lib/raid/xor/um/xor_arch.h\n rename arch/x86/include/asm/xor.h => lib/raid/xor/x86/xor_arch.h (89%)\n rename {include/linux/raid => lib/raid/xor}/xor_impl.h (80%)",
    "diff": "diff --git a/arch/um/include/asm/xor.h b/arch/um/include/asm/xor.h\ndeleted file mode 100644\nindex 99e5c7e1f475..000000000000\n--- a/arch/um/include/asm/xor.h\n+++ /dev/null\n@@ -1,8 +0,0 @@\n-/* SPDX-License-Identifier: GPL-2.0 */\n-#ifndef _ASM_UM_XOR_H\n-#define _ASM_UM_XOR_H\n-\n-#include <asm/cpufeature.h>\n-#include <../../x86/include/asm/xor.h>\n-\n-#endif\ndiff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild\nindex 9aff61e7b8f2..2c53a1e0b760 100644\n--- a/include/asm-generic/Kbuild\n+++ b/include/asm-generic/Kbuild\n@@ -65,4 +65,3 @@ mandatory-y += vermagic.h\n mandatory-y += vga.h\n mandatory-y += video.h\n mandatory-y += word-at-a-time.h\n-mandatory-y += xor.h\ndiff --git a/include/asm-generic/xor.h b/include/asm-generic/xor.h\ndeleted file mode 100644\nindex fc151fdc45ab..000000000000\n--- a/include/asm-generic/xor.h\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-/* SPDX-License-Identifier: GPL-2.0-or-later */\n-/*\n- * include/asm-generic/xor.h\n- *\n- * Generic optimized RAID-5 checksumming functions.\n- */\n-\n-extern struct xor_block_template xor_block_8regs;\n-extern struct xor_block_template xor_block_32regs;\n-extern struct xor_block_template xor_block_8regs_p;\n-extern struct xor_block_template xor_block_32regs_p;\ndiff --git a/lib/raid/Kconfig b/lib/raid/Kconfig\nindex 01b73a1c303f..81cb3f9c0a7b 100644\n--- a/lib/raid/Kconfig\n+++ b/lib/raid/Kconfig\n@@ -2,3 +2,18 @@\n \n config XOR_BLOCKS\n \ttristate\n+\n+# selected by architectures that provide an optimized XOR implementation\n+config XOR_BLOCKS_ARCH\n+\tdepends on XOR_BLOCKS\n+\tdefault y if ALPHA\n+\tdefault y if ARM\n+\tdefault y if ARM64\n+\tdefault y if CPU_HAS_LSX\t\t# loongarch\n+\tdefault y if ALTIVEC\t\t\t# powerpc\n+\tdefault y if RISCV_ISA_V\n+\tdefault y if SPARC\n+\tdefault y if S390\n+\tdefault y if X86_32\n+\tdefault y if X86_64\n+\tbool\ndiff --git a/lib/raid/xor/Makefile b/lib/raid/xor/Makefile\nindex 05aca96041b3..df55823c4d82 100644\n--- a/lib/raid/xor/Makefile\n+++ b/lib/raid/xor/Makefile\n@@ -1,5 +1,7 @@\n # SPDX-License-Identifier: GPL-2.0\n \n+ccflags-y\t\t\t+= -I $(src)\n+\n obj-$(CONFIG_XOR_BLOCKS)\t+= xor.o\n \n xor-y\t\t\t\t+= xor-core.o\n@@ -8,6 +10,10 @@ xor-y\t\t\t\t+= xor-32regs.o\n xor-y\t\t\t\t+= xor-8regs-prefetch.o\n xor-y\t\t\t\t+= xor-32regs-prefetch.o\n \n+ifeq ($(CONFIG_XOR_BLOCKS_ARCH),y)\n+CFLAGS_xor-core.o\t\t+= -I$(src)/$(SRCARCH)\n+endif\n+\n xor-$(CONFIG_ALPHA)\t\t+= alpha/xor.o\n xor-$(CONFIG_ARM)\t\t+= arm/xor.o\n ifeq ($(CONFIG_ARM),y)\ndiff --git a/lib/raid/xor/alpha/xor.c b/lib/raid/xor/alpha/xor.c\nindex 0964ac420604..90694cc47395 100644\n--- a/lib/raid/xor/alpha/xor.c\n+++ b/lib/raid/xor/alpha/xor.c\n@@ -2,8 +2,8 @@\n /*\n  * Optimized XOR parity functions for alpha EV5 and EV6\n  */\n-#include <linux/raid/xor_impl.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n extern void\n xor_alpha_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/arch/alpha/include/asm/xor.h b/lib/raid/xor/alpha/xor_arch.h\nsimilarity index 90%\nrename from arch/alpha/include/asm/xor.h\nrename to lib/raid/xor/alpha/xor_arch.h\nindex e517be577a09..0dcfea578a48 100644\n--- a/arch/alpha/include/asm/xor.h\n+++ b/lib/raid/xor/alpha/xor_arch.h\n@@ -1,7 +1,6 @@\n /* SPDX-License-Identifier: GPL-2.0-or-later */\n \n #include <asm/special_insns.h>\n-#include <asm-generic/xor.h>\n \n extern struct xor_block_template xor_block_alpha;\n extern struct xor_block_template xor_block_alpha_prefetch;\n@@ -10,7 +9,6 @@ extern struct xor_block_template xor_block_alpha_prefetch;\n  * Force the use of alpha_prefetch if EV6, as it is significantly faster in the\n  * cold cache case.\n  */\n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \tif (implver() == IMPLVER_EV6) {\ndiff --git a/lib/raid/xor/arm/xor-neon-glue.c b/lib/raid/xor/arm/xor-neon-glue.c\nindex c7b162b383a2..7afd6294464b 100644\n--- a/lib/raid/xor/arm/xor-neon-glue.c\n+++ b/lib/raid/xor/arm/xor-neon-glue.c\n@@ -2,8 +2,8 @@\n /*\n  *  Copyright (C) 2001 Russell King\n  */\n-#include <linux/raid/xor_impl.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n extern struct xor_block_template const xor_block_neon_inner;\n \ndiff --git a/lib/raid/xor/arm/xor-neon.c b/lib/raid/xor/arm/xor-neon.c\nindex c9d4378b0f0e..806a42c5952c 100644\n--- a/lib/raid/xor/arm/xor-neon.c\n+++ b/lib/raid/xor/arm/xor-neon.c\n@@ -3,7 +3,7 @@\n  * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org>\n  */\n \n-#include <linux/raid/xor_impl.h>\n+#include \"xor_impl.h\"\n \n #ifndef __ARM_NEON__\n #error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon'\ndiff --git a/lib/raid/xor/arm/xor.c b/lib/raid/xor/arm/xor.c\nindex 2263341dbbcd..5bd5f048bbe9 100644\n--- a/lib/raid/xor/arm/xor.c\n+++ b/lib/raid/xor/arm/xor.c\n@@ -2,8 +2,8 @@\n /*\n  *  Copyright (C) 2001 Russell King\n  */\n-#include <linux/raid/xor_impl.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n #define __XOR(a1, a2) a1 ^= a2\n \ndiff --git a/arch/arm/include/asm/xor.h b/lib/raid/xor/arm/xor_arch.h\nsimilarity index 87%\nrename from arch/arm/include/asm/xor.h\nrename to lib/raid/xor/arm/xor_arch.h\nindex 989c55872ef6..5a7eedb48fbb 100644\n--- a/arch/arm/include/asm/xor.h\n+++ b/lib/raid/xor/arm/xor_arch.h\n@@ -2,13 +2,11 @@\n /*\n  *  Copyright (C) 2001 Russell King\n  */\n-#include <asm-generic/xor.h>\n #include <asm/neon.h>\n \n extern struct xor_block_template xor_block_arm4regs;\n extern struct xor_block_template xor_block_neon;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_register(&xor_block_arm4regs);\ndiff --git a/lib/raid/xor/arm64/xor-neon-glue.c b/lib/raid/xor/arm64/xor-neon-glue.c\nindex 08c3e3573388..3db0a318cf5b 100644\n--- a/lib/raid/xor/arm64/xor-neon-glue.c\n+++ b/lib/raid/xor/arm64/xor-neon-glue.c\n@@ -4,9 +4,9 @@\n  * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.\n  */\n \n-#include <linux/raid/xor_impl.h>\n #include <asm/simd.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n #include \"xor-neon.h\"\n \n #define XOR_TEMPLATE(_name)\t\t\t\t\t\t\\\ndiff --git a/lib/raid/xor/arm64/xor-neon.c b/lib/raid/xor/arm64/xor-neon.c\nindex 61194c292917..61f00c4fee49 100644\n--- a/lib/raid/xor/arm64/xor-neon.c\n+++ b/lib/raid/xor/arm64/xor-neon.c\n@@ -4,10 +4,10 @@\n  * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.\n  */\n \n-#include <linux/raid/xor_impl.h>\n #include <linux/cache.h>\n #include <asm/neon-intrinsics.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n #include \"xor-neon.h\"\n \n void __xor_neon_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/arch/arm64/include/asm/xor.h b/lib/raid/xor/arm64/xor_arch.h\nsimilarity index 89%\nrename from arch/arm64/include/asm/xor.h\nrename to lib/raid/xor/arm64/xor_arch.h\nindex 4782c760bcac..5dbb40319501 100644\n--- a/arch/arm64/include/asm/xor.h\n+++ b/lib/raid/xor/arm64/xor_arch.h\n@@ -3,14 +3,11 @@\n  * Authors: Jackie Liu <liuyun01@kylinos.cn>\n  * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.\n  */\n-\n-#include <asm-generic/xor.h>\n #include <asm/simd.h>\n \n extern struct xor_block_template xor_block_neon;\n extern struct xor_block_template xor_block_eor3;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_register(&xor_block_8regs);\ndiff --git a/arch/loongarch/include/asm/xor.h b/lib/raid/xor/loongarch/xor_arch.h\nsimilarity index 85%\nrename from arch/loongarch/include/asm/xor.h\nrename to lib/raid/xor/loongarch/xor_arch.h\nindex 7e32f72f8b03..fe5e8244fd0e 100644\n--- a/arch/loongarch/include/asm/xor.h\n+++ b/lib/raid/xor/loongarch/xor_arch.h\n@@ -2,9 +2,6 @@\n /*\n  * Copyright (C) 2023 WANG Xuerui <git@xen0n.name>\n  */\n-#ifndef _ASM_LOONGARCH_XOR_H\n-#define _ASM_LOONGARCH_XOR_H\n-\n #include <asm/cpu-features.h>\n \n /*\n@@ -15,12 +12,10 @@\n  * the scalar ones, maybe for errata or micro-op reasons. It may be\n  * appropriate to revisit this after one or two more uarch generations.\n  */\n-#include <asm-generic/xor.h>\n \n extern struct xor_block_template xor_block_lsx;\n extern struct xor_block_template xor_block_lasx;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_register(&xor_block_8regs);\n@@ -36,5 +31,3 @@ static __always_inline void __init arch_xor_init(void)\n \t\txor_register(&xor_block_lasx);\n #endif\n }\n-\n-#endif /* _ASM_LOONGARCH_XOR_H */\ndiff --git a/lib/raid/xor/loongarch/xor_simd_glue.c b/lib/raid/xor/loongarch/xor_simd_glue.c\nindex 11fa3b47ba83..b387aa0213b4 100644\n--- a/lib/raid/xor/loongarch/xor_simd_glue.c\n+++ b/lib/raid/xor/loongarch/xor_simd_glue.c\n@@ -6,9 +6,9 @@\n  */\n \n #include <linux/sched.h>\n-#include <linux/raid/xor_impl.h>\n #include <asm/fpu.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n #include \"xor_simd.h\"\n \n #define MAKE_XOR_GLUE_2(flavor)\t\t\t\t\t\t\t\\\ndiff --git a/arch/powerpc/include/asm/xor.h b/lib/raid/xor/powerpc/xor_arch.h\nsimilarity index 77%\nrename from arch/powerpc/include/asm/xor.h\nrename to lib/raid/xor/powerpc/xor_arch.h\nindex 3293ac87181c..3b00a4a2fd67 100644\n--- a/arch/powerpc/include/asm/xor.h\n+++ b/lib/raid/xor/powerpc/xor_arch.h\n@@ -5,15 +5,10 @@\n  *\n  * Author: Anton Blanchard <anton@au.ibm.com>\n  */\n-#ifndef _ASM_POWERPC_XOR_H\n-#define _ASM_POWERPC_XOR_H\n-\n #include <asm/cpu_has_feature.h>\n-#include <asm-generic/xor.h>\n \n extern struct xor_block_template xor_block_altivec;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_register(&xor_block_8regs);\n@@ -25,5 +20,3 @@ static __always_inline void __init arch_xor_init(void)\n \t\txor_register(&xor_block_altivec);\n #endif\n }\n-\n-#endif /* _ASM_POWERPC_XOR_H */\ndiff --git a/lib/raid/xor/powerpc/xor_vmx_glue.c b/lib/raid/xor/powerpc/xor_vmx_glue.c\nindex c41e38340700..56e99ddfb64f 100644\n--- a/lib/raid/xor/powerpc/xor_vmx_glue.c\n+++ b/lib/raid/xor/powerpc/xor_vmx_glue.c\n@@ -7,9 +7,9 @@\n \n #include <linux/preempt.h>\n #include <linux/sched.h>\n-#include <linux/raid/xor_impl.h>\n #include <asm/switch_to.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n #include \"xor_vmx.h\"\n \n static void xor_altivec_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/lib/raid/xor/riscv/xor-glue.c b/lib/raid/xor/riscv/xor-glue.c\nindex 11666a4b6b68..060e5f22ebcc 100644\n--- a/lib/raid/xor/riscv/xor-glue.c\n+++ b/lib/raid/xor/riscv/xor-glue.c\n@@ -3,11 +3,11 @@\n  * Copyright (C) 2021 SiFive\n  */\n \n-#include <linux/raid/xor_impl.h>\n #include <asm/vector.h>\n #include <asm/switch_to.h>\n #include <asm/asm-prototypes.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n static void xor_vector_2(unsigned long bytes, unsigned long *__restrict p1,\n \t\t\t const unsigned long *__restrict p2)\ndiff --git a/arch/riscv/include/asm/xor.h b/lib/raid/xor/riscv/xor_arch.h\nsimilarity index 84%\nrename from arch/riscv/include/asm/xor.h\nrename to lib/raid/xor/riscv/xor_arch.h\nindex 614d9209d078..9240857d760b 100644\n--- a/arch/riscv/include/asm/xor.h\n+++ b/lib/raid/xor/riscv/xor_arch.h\n@@ -3,11 +3,9 @@\n  * Copyright (C) 2021 SiFive\n  */\n #include <asm/vector.h>\n-#include <asm-generic/xor.h>\n \n extern struct xor_block_template xor_block_rvv;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_register(&xor_block_8regs);\ndiff --git a/lib/raid/xor/s390/xor.c b/lib/raid/xor/s390/xor.c\nindex acbd268adfc8..c28cb56fec92 100644\n--- a/lib/raid/xor/s390/xor.c\n+++ b/lib/raid/xor/s390/xor.c\n@@ -7,8 +7,8 @@\n  */\n \n #include <linux/types.h>\n-#include <linux/raid/xor_impl.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,\n \t\t     const unsigned long * __restrict p2)\ndiff --git a/arch/s390/include/asm/xor.h b/lib/raid/xor/s390/xor_arch.h\nsimilarity index 71%\nrename from arch/s390/include/asm/xor.h\nrename to lib/raid/xor/s390/xor_arch.h\nindex 4e2233f64da9..4a233ed2b97a 100644\n--- a/arch/s390/include/asm/xor.h\n+++ b/lib/raid/xor/s390/xor_arch.h\n@@ -5,15 +5,9 @@\n  * Copyright IBM Corp. 2016\n  * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>\n  */\n-#ifndef _ASM_S390_XOR_H\n-#define _ASM_S390_XOR_H\n-\n extern struct xor_block_template xor_block_xc;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_force(&xor_block_xc);\n }\n-\n-#endif /* _ASM_S390_XOR_H */\ndiff --git a/lib/raid/xor/sparc/xor-sparc32.c b/lib/raid/xor/sparc/xor-sparc32.c\nindex b65a75a6e59d..307c4a84f535 100644\n--- a/lib/raid/xor/sparc/xor-sparc32.c\n+++ b/lib/raid/xor/sparc/xor-sparc32.c\n@@ -5,8 +5,8 @@\n  *\n  * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)\n  */\n-#include <linux/raid/xor_impl.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n static void\n sparc_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/lib/raid/xor/sparc/xor-sparc64-glue.c b/lib/raid/xor/sparc/xor-sparc64-glue.c\nindex 3c67c8c3a0e8..5f90c2460b54 100644\n--- a/lib/raid/xor/sparc/xor-sparc64-glue.c\n+++ b/lib/raid/xor/sparc/xor-sparc64-glue.c\n@@ -8,8 +8,8 @@\n  * Copyright (C) 2006 David S. Miller <davem@davemloft.net>\n  */\n \n-#include <linux/raid/xor_impl.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n void xor_vis_2(unsigned long bytes, unsigned long * __restrict p1,\n \t       const unsigned long * __restrict p2);\ndiff --git a/arch/sparc/include/asm/xor.h b/lib/raid/xor/sparc/xor_arch.h\nsimilarity index 81%\nrename from arch/sparc/include/asm/xor.h\nrename to lib/raid/xor/sparc/xor_arch.h\nindex f923b009fc24..af288abe4e91 100644\n--- a/arch/sparc/include/asm/xor.h\n+++ b/lib/raid/xor/sparc/xor_arch.h\n@@ -3,16 +3,12 @@\n  * Copyright (C) 1997, 1999 Jakub Jelinek (jj@ultra.linux.cz)\n  * Copyright (C) 2006 David S. Miller <davem@davemloft.net>\n  */\n-#ifndef ___ASM_SPARC_XOR_H\n-#define ___ASM_SPARC_XOR_H\n-\n #if defined(__sparc__) && defined(__arch64__)\n #include <asm/spitfire.h>\n \n extern struct xor_block_template xor_block_VIS;\n extern struct xor_block_template xor_block_niagara;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \t/* Force VIS for everything except Niagara.  */\n@@ -28,12 +24,8 @@ static __always_inline void __init arch_xor_init(void)\n }\n #else /* sparc64 */\n \n-/* For grins, also test the generic routines.  */\n-#include <asm-generic/xor.h>\n-\n extern struct xor_block_template xor_block_SPARC;\n \n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \txor_register(&xor_block_8regs);\n@@ -41,4 +33,3 @@ static __always_inline void __init arch_xor_init(void)\n \txor_register(&xor_block_SPARC);\n }\n #endif /* !sparc64 */\n-#endif /* ___ASM_SPARC_XOR_H */\ndiff --git a/lib/raid/xor/um/xor_arch.h b/lib/raid/xor/um/xor_arch.h\nnew file mode 100644\nindex 000000000000..a33e57a26c5e\n--- /dev/null\n+++ b/lib/raid/xor/um/xor_arch.h\n@@ -0,0 +1,2 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+#include <../x86/xor_arch.h>\ndiff --git a/lib/raid/xor/x86/xor-avx.c b/lib/raid/xor/x86/xor-avx.c\nindex b49cb5199e70..d411efa1ff43 100644\n--- a/lib/raid/xor/x86/xor-avx.c\n+++ b/lib/raid/xor/x86/xor-avx.c\n@@ -8,9 +8,9 @@\n  * Based on Ingo Molnar and Zach Brown's respective MMX and SSE routines\n  */\n #include <linux/compiler.h>\n-#include <linux/raid/xor_impl.h>\n #include <asm/fpu/api.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n #define BLOCK4(i) \\\n \t\tBLOCK(32 * i, 0) \\\ndiff --git a/lib/raid/xor/x86/xor-mmx.c b/lib/raid/xor/x86/xor-mmx.c\nindex cf0fafea33b7..e48c58f92874 100644\n--- a/lib/raid/xor/x86/xor-mmx.c\n+++ b/lib/raid/xor/x86/xor-mmx.c\n@@ -4,9 +4,9 @@\n  *\n  * Copyright (C) 1998 Ingo Molnar.\n  */\n-#include <linux/raid/xor_impl.h>\n #include <asm/fpu/api.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n #define LD(x, y)\t\"       movq   8*(\"#x\")(%1), %%mm\"#y\"   ;\\n\"\n #define ST(x, y)\t\"       movq %%mm\"#y\",   8*(\"#x\")(%1)   ;\\n\"\ndiff --git a/lib/raid/xor/x86/xor-sse.c b/lib/raid/xor/x86/xor-sse.c\nindex 0e727ced8b00..5993ed688c15 100644\n--- a/lib/raid/xor/x86/xor-sse.c\n+++ b/lib/raid/xor/x86/xor-sse.c\n@@ -12,9 +12,9 @@\n  * x86-64 changes / gcc fixes from Andi Kleen.\n  * Copyright 2002 Andi Kleen, SuSE Labs.\n  */\n-#include <linux/raid/xor_impl.h>\n #include <asm/fpu/api.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n+#include \"xor_arch.h\"\n \n #ifdef CONFIG_X86_32\n /* reduce register pressure */\ndiff --git a/arch/x86/include/asm/xor.h b/lib/raid/xor/x86/xor_arch.h\nsimilarity index 89%\nrename from arch/x86/include/asm/xor.h\nrename to lib/raid/xor/x86/xor_arch.h\nindex d1aab8275908..99fe85a213c6 100644\n--- a/arch/x86/include/asm/xor.h\n+++ b/lib/raid/xor/x86/xor_arch.h\n@@ -1,9 +1,5 @@\n /* SPDX-License-Identifier: GPL-2.0-or-later */\n-#ifndef _ASM_X86_XOR_H\n-#define _ASM_X86_XOR_H\n-\n #include <asm/cpufeature.h>\n-#include <asm-generic/xor.h>\n \n extern struct xor_block_template xor_block_pII_mmx;\n extern struct xor_block_template xor_block_p5_mmx;\n@@ -20,7 +16,6 @@ extern struct xor_block_template xor_block_avx;\n  *\n  * 32-bit without MMX can fall back to the generic routines.\n  */\n-#define arch_xor_init arch_xor_init\n static __always_inline void __init arch_xor_init(void)\n {\n \tif (boot_cpu_has(X86_FEATURE_AVX) &&\n@@ -39,5 +34,3 @@ static __always_inline void __init arch_xor_init(void)\n \t\txor_register(&xor_block_32regs_p);\n \t}\n }\n-\n-#endif /* _ASM_X86_XOR_H */\ndiff --git a/lib/raid/xor/xor-32regs-prefetch.c b/lib/raid/xor/xor-32regs-prefetch.c\nindex 8666c287f777..2856a8e50cb8 100644\n--- a/lib/raid/xor/xor-32regs-prefetch.c\n+++ b/lib/raid/xor/xor-32regs-prefetch.c\n@@ -1,7 +1,6 @@\n // SPDX-License-Identifier: GPL-2.0-or-later\n #include <linux/prefetch.h>\n-#include <linux/raid/xor_impl.h>\n-#include <asm-generic/xor.h>\n+#include \"xor_impl.h\"\n \n static void\n xor_32regs_p_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/lib/raid/xor/xor-32regs.c b/lib/raid/xor/xor-32regs.c\nindex 58d4fac43eb4..cc44d64032fa 100644\n--- a/lib/raid/xor/xor-32regs.c\n+++ b/lib/raid/xor/xor-32regs.c\n@@ -1,6 +1,5 @@\n // SPDX-License-Identifier: GPL-2.0-or-later\n-#include <linux/raid/xor_impl.h>\n-#include <asm-generic/xor.h>\n+#include \"xor_impl.h\"\n \n static void\n xor_32regs_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/lib/raid/xor/xor-8regs-prefetch.c b/lib/raid/xor/xor-8regs-prefetch.c\nindex 67061e35a0a6..1d53aec50d27 100644\n--- a/lib/raid/xor/xor-8regs-prefetch.c\n+++ b/lib/raid/xor/xor-8regs-prefetch.c\n@@ -1,7 +1,6 @@\n // SPDX-License-Identifier: GPL-2.0-or-later\n #include <linux/prefetch.h>\n-#include <linux/raid/xor_impl.h>\n-#include <asm-generic/xor.h>\n+#include \"xor_impl.h\"\n \n static void\n xor_8regs_p_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/lib/raid/xor/xor-8regs.c b/lib/raid/xor/xor-8regs.c\nindex 769f796ab2cf..72a44e898c55 100644\n--- a/lib/raid/xor/xor-8regs.c\n+++ b/lib/raid/xor/xor-8regs.c\n@@ -1,6 +1,5 @@\n // SPDX-License-Identifier: GPL-2.0-or-later\n-#include <linux/raid/xor_impl.h>\n-#include <asm-generic/xor.h>\n+#include \"xor_impl.h\"\n \n static void\n xor_8regs_2(unsigned long bytes, unsigned long * __restrict p1,\ndiff --git a/lib/raid/xor/xor-core.c b/lib/raid/xor/xor-core.c\nindex 93608b5fece9..de1d2899490a 100644\n--- a/lib/raid/xor/xor-core.c\n+++ b/lib/raid/xor/xor-core.c\n@@ -9,10 +9,9 @@\n #include <linux/module.h>\n #include <linux/gfp.h>\n #include <linux/raid/xor.h>\n-#include <linux/raid/xor_impl.h>\n #include <linux/jiffies.h>\n #include <linux/preempt.h>\n-#include <asm/xor.h>\n+#include \"xor_impl.h\"\n \n /* The xor routines to use.  */\n static struct xor_block_template *active_template;\n@@ -141,16 +140,21 @@ static int __init calibrate_xor_blocks(void)\n \treturn 0;\n }\n \n-static int __init xor_init(void)\n-{\n-#ifdef arch_xor_init\n-\tarch_xor_init();\n+#ifdef CONFIG_XOR_BLOCKS_ARCH\n+#include \"xor_arch.h\" /* $SRCARCH/xor_arch.h */\n #else\n+static void __init arch_xor_init(void)\n+{\n \txor_register(&xor_block_8regs);\n \txor_register(&xor_block_8regs_p);\n \txor_register(&xor_block_32regs);\n \txor_register(&xor_block_32regs_p);\n-#endif\n+}\n+#endif /* CONFIG_XOR_BLOCKS_ARCH */\n+\n+static int __init xor_init(void)\n+{\n+\tarch_xor_init();\n \n \t/*\n \t * If this arch/cpu has a short-circuited selection, don't loop through\ndiff --git a/include/linux/raid/xor_impl.h b/lib/raid/xor/xor_impl.h\nsimilarity index 80%\nrename from include/linux/raid/xor_impl.h\nrename to lib/raid/xor/xor_impl.h\nindex 6ed4c445ab24..44b6c99e2093 100644\n--- a/include/linux/raid/xor_impl.h\n+++ b/lib/raid/xor/xor_impl.h\n@@ -24,6 +24,12 @@ struct xor_block_template {\n \t\t     const unsigned long * __restrict);\n };\n \n+/* generic implementations */\n+extern struct xor_block_template xor_block_8regs;\n+extern struct xor_block_template xor_block_32regs;\n+extern struct xor_block_template xor_block_8regs_p;\n+extern struct xor_block_template xor_block_32regs_p;\n+\n void __init xor_register(struct xor_block_template *tmpl);\n void __init xor_force(struct xor_block_template *tmpl);\n \n",
    "prefixes": [
        "21/28"
    ]
}