Skip to contentSkip to conversation

Patch "arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h" has been added to the 6.18-stable tree

DISCUSSION Nathan Chancellor 2 participants 3 messages Dec 2 – Dec 3 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 2026120251-scarce-wrongdoer-3631@gregkh

#1 lore raw

Hi Greg,

Quoted 49 lines · On Wed, Dec 02, 2026 at 05:15:52PM +0100, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h

to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
arm64-drop-stdint.h-type-overrides-from-asm-neon-intrinsics.h.patch
and it can be found in the queue-6.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From a041bdbe1f3a8efa8a527a89c84d3771232b4942 Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Thu, 29 Oct 2026 14:50:23 +0100
Subject: arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h

From: Ard Biesheuvel <[email protected]>

commit a041bdbe1f3a8efa8a527a89c84d3771232b4942 upstream.

None of the users of NEON intrinsics include <linux/types.h> anymore, and so there is no longer a need to override __INT64_TYPE__ and __UINT64_TYPE__ in order to make the definitions of int64_t and uint64_t provided by the compiler's freestanding <stdint.h> compatible with the kernel's. So drop the overrides.

This also means that uint64_t now matches the type that Clang uses for 64-bit quantities in the prototypes of its NEON builtins, and so the -Wincompatible-pointer-types warnings that are currently being disabled for all NEON intrinsics code will no longer occur. So drop the pragma that disables them as well.

---
 arch/arm64/include/asm/neon-intrinsics.h |   24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

arch/arm64/include/asm/neon-intrinsics.h

Quoted 1 line
arch/arm64/include/asm/neon-intrinsics.h +0 -0
...

This cannot go to 6.18 without an adaptation of

14e346032143 ("xor: arm/arm64: Move NEON xor_gen() dispatch into the glue code")

for arch/arm64/lib/xor-neon.c; otherwise, the build just breaks in a different way for everyone:

In file included from arch/arm64/lib/xor-neon.c:11:
In file included from arch/arm64/include/asm/neon-intrinsics.h:23:
In file included from .../lib/clang/24/include/arm_neon.h:33:
.../lib/clang/24/include/stdint.h:100:24: error: typedef redefinition with different types ('long' vs 's64' (aka 'long long'))

    100 | typedef __INT64_TYPE__ int64_t;
        |                        ^
  include/linux/types.h:116:15: note: previous definition is here
    116 | typedef s64                     int64_t;
        |                                 ^
  In file included from arch/arm64/lib/xor-neon.c:11:
  In file included from arch/arm64/include/asm/neon-intrinsics.h:23:
  In file included from .../lib/clang/24/include/arm_neon.h:33:
  .../lib/clang/24/include/stdint.h:102:25: error: typedef redefinition with different types ('unsigned long' vs 'u64' (aka 'unsigned long long'))
    102 | typedef __UINT64_TYPE__ uint64_t;
        |                         ^
  include/linux/types.h:114:15: note: previous definition is here
    114 | typedef u64                     uint64_t;
        |                                 ^

Ard, I guess that would be something like this for 6.18 at least? I don't mind sending full patches if it looks right.

arch/arm64/lib/Makefile +1 -1
index a74507503a4a..6c7a31c8533c 100644
@@ -10,7 +10,7 @@ lib-y		:= clear_user.o delay.o copy_from_user.o		\
 		   strnlen.o strchr.o strrchr.o tishift.o
 
 ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
-obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon.o
+obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon-init.o xor-neon.o
 CFLAGS_xor-neon.o		+= $(CC_FLAGS_FPU)
 CFLAGS_REMOVE_xor-neon.o	+= $(CC_FLAGS_NO_FPU)
 endif
arch/arm64/lib/xor-neon-init.c new file +40 -0
new file mode 100644
index 000000000000..ca201b17cb39
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * arch/arm64/lib/xor-neon-init.c
+ *
+ * Authors: Jackie Liu <[email protected]>
+ * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
+ */
+
+#include <linux/raid/xor.h>
+#include <linux/module.h>
+#include "xor-neon.h"
+
+struct xor_block_template xor_block_inner_neon __ro_after_init = {
+	.name	= "__inner_neon__",
+	.do_2	= xor_arm64_neon_2,
+	.do_3	= xor_arm64_neon_3,
+	.do_4	= xor_arm64_neon_4,
+	.do_5	= xor_arm64_neon_5,
+};
+EXPORT_SYMBOL(xor_block_inner_neon);
+
+static int __init xor_neon_init(void)
+{
+	if (cpu_have_named_feature(SHA3)) {
+		xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
+		xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
+		xor_block_inner_neon.do_5 = xor_arm64_eor3_5;
+	}
+	return 0;
+}
+module_init(xor_neon_init);
+
+static void __exit xor_neon_exit(void)
+{
+}
+module_exit(xor_neon_exit);
+
+MODULE_AUTHOR("Jackie Liu <[email protected]>");
+MODULE_DESCRIPTION("ARMv8 XOR Extensions");
+MODULE_LICENSE("GPL");
arch/arm64/lib/xor-neon.c +8 -38

99 lines not on this page · raw message

arch/arm64/lib/xor-neon.h new file +37 -0
new file mode 100644
index 000000000000..f0a30af1ef33
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * arch/arm64/lib/xor-neon.h
+ *
+ * Authors: Jackie Liu <[email protected]>
+ * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
+ */
+
+void xor_arm64_neon_2(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2);
+void xor_arm64_neon_3(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3);
+void xor_arm64_neon_4(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4);
+void xor_arm64_neon_5(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4,
+	const unsigned long * __restrict p5);
+void xor_arm64_eor3_3(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3);
+void xor_arm64_eor3_4(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4);
+void xor_arm64_eor3_5(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4,
+	const unsigned long * __restrict p5);
Signature · 2 lines
Cheers,
Nathan
#2 lore raw
Quoted 80 lines · Nathan Chancellor

Hi Greg,

Quoted 49 lines · On Wed, Dec 02, 2026 at 05:15:52PM +0100, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h

to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
arm64-drop-stdint.h-type-overrides-from-asm-neon-intrinsics.h.patch
and it can be found in the queue-6.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From a041bdbe1f3a8efa8a527a89c84d3771232b4942 Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Thu, 29 Oct 2026 14:50:23 +0100
Subject: arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h

From: Ard Biesheuvel <[email protected]>

commit a041bdbe1f3a8efa8a527a89c84d3771232b4942 upstream.

None of the users of NEON intrinsics include <linux/types.h> anymore, and so there is no longer a need to override __INT64_TYPE__ and __UINT64_TYPE__ in order to make the definitions of int64_t and uint64_t provided by the compiler's freestanding <stdint.h> compatible with the kernel's. So drop the overrides.

This also means that uint64_t now matches the type that Clang uses for 64-bit quantities in the prototypes of its NEON builtins, and so the -Wincompatible-pointer-types warnings that are currently being disabled for all NEON intrinsics code will no longer occur. So drop the pragma that disables them as well.

---
 arch/arm64/include/asm/neon-intrinsics.h |   24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

arch/arm64/include/asm/neon-intrinsics.h

Quoted 1 line
arch/arm64/include/asm/neon-intrinsics.h +0 -0
...

This cannot go to 6.18 without an adaptation of

14e346032143 ("xor: arm/arm64: Move NEON xor_gen() dispatch into the glue code")

for arch/arm64/lib/xor-neon.c; otherwise, the build just breaks in a different way for everyone:

In file included from arch/arm64/lib/xor-neon.c:11:
In file included from arch/arm64/include/asm/neon-intrinsics.h:23:
In file included from .../lib/clang/24/include/arm_neon.h:33:
.../lib/clang/24/include/stdint.h:100:24: error: typedef redefinition with different types ('long' vs 's64' (aka 'long long'))

    100 | typedef __INT64_TYPE__ int64_t;
        |                        ^
  include/linux/types.h:116:15: note: previous definition is here
    116 | typedef s64                     int64_t;
        |                                 ^
  In file included from arch/arm64/lib/xor-neon.c:11:
  In file included from arch/arm64/include/asm/neon-intrinsics.h:23:
  In file included from .../lib/clang/24/include/arm_neon.h:33:
  .../lib/clang/24/include/stdint.h:102:25: error: typedef redefinition with different types ('unsigned long' vs 'u64' (aka 'unsigned long long'))
    102 | typedef __UINT64_TYPE__ uint64_t;
        |                         ^
  include/linux/types.h:114:15: note: previous definition is here
    114 | typedef u64                     uint64_t;
        |                                 ^
Quoted 2 lines

Ard, I guess that would be something like this for 6.18 at least? I don't mind sending full patches if it looks right.

Whoops, that one had modpost problems (didn't let my build finish before sending...), this one should be better.

arch/arm64/lib/Makefile +2 -1
index a74507503a4a..a1c831386789 100644
@@ -10,7 +10,8 @@ lib-y		:= clear_user.o delay.o copy_from_user.o		\
 		   strnlen.o strchr.o strrchr.o tishift.o
 
 ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
-obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon.o
+obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon-arm64.o
+xor-neon-arm64-y := xor-neon-init.o xor-neon.o
 CFLAGS_xor-neon.o		+= $(CC_FLAGS_FPU)
 CFLAGS_REMOVE_xor-neon.o	+= $(CC_FLAGS_NO_FPU)
 endif
arch/arm64/lib/xor-neon-init.c new file +40 -0
new file mode 100644
index 000000000000..ca201b17cb39
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * arch/arm64/lib/xor-neon-init.c
+ *
+ * Authors: Jackie Liu <[email protected]>
+ * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
+ */
+
+#include <linux/raid/xor.h>
+#include <linux/module.h>
+#include "xor-neon.h"
+
+struct xor_block_template xor_block_inner_neon __ro_after_init = {
+	.name	= "__inner_neon__",
+	.do_2	= xor_arm64_neon_2,
+	.do_3	= xor_arm64_neon_3,
+	.do_4	= xor_arm64_neon_4,
+	.do_5	= xor_arm64_neon_5,
+};
+EXPORT_SYMBOL(xor_block_inner_neon);
+
+static int __init xor_neon_init(void)
+{
+	if (cpu_have_named_feature(SHA3)) {
+		xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
+		xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
+		xor_block_inner_neon.do_5 = xor_arm64_eor3_5;
+	}
+	return 0;
+}
+module_init(xor_neon_init);
+
+static void __exit xor_neon_exit(void)
+{
+}
+module_exit(xor_neon_exit);
+
+MODULE_AUTHOR("Jackie Liu <[email protected]>");
+MODULE_DESCRIPTION("ARMv8 XOR Extensions");
+MODULE_LICENSE("GPL");
arch/arm64/lib/xor-neon.c +8 -38

99 lines not on this page · raw message

arch/arm64/lib/xor-neon.h new file +37 -0
new file mode 100644
index 000000000000..f0a30af1ef33
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * arch/arm64/lib/xor-neon.h
+ *
+ * Authors: Jackie Liu <[email protected]>
+ * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
+ */
+
+void xor_arm64_neon_2(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2);
+void xor_arm64_neon_3(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3);
+void xor_arm64_neon_4(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4);
+void xor_arm64_neon_5(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4,
+	const unsigned long * __restrict p5);
+void xor_arm64_eor3_3(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3);
+void xor_arm64_eor3_4(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4);
+void xor_arm64_eor3_5(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4,
+	const unsigned long * __restrict p5);
Signature · 2 lines
Cheers,
Nathan
maintainer
#3 lore raw
Quoted 292 lines · Nathan Chancellor
Quoted 80 lines · Nathan Chancellor

Hi Greg,

Quoted 49 lines · On Wed, Dec 02, 2026 at 05:15:52PM +0100, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h

to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
arm64-drop-stdint.h-type-overrides-from-asm-neon-intrinsics.h.patch
and it can be found in the queue-6.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From a041bdbe1f3a8efa8a527a89c84d3771232b4942 Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Thu, 29 Oct 2026 14:50:23 +0100
Subject: arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h

From: Ard Biesheuvel <[email protected]>

commit a041bdbe1f3a8efa8a527a89c84d3771232b4942 upstream.

None of the users of NEON intrinsics include <linux/types.h> anymore, and so there is no longer a need to override __INT64_TYPE__ and __UINT64_TYPE__ in order to make the definitions of int64_t and uint64_t provided by the compiler's freestanding <stdint.h> compatible with the kernel's. So drop the overrides.

This also means that uint64_t now matches the type that Clang uses for 64-bit quantities in the prototypes of its NEON builtins, and so the -Wincompatible-pointer-types warnings that are currently being disabled for all NEON intrinsics code will no longer occur. So drop the pragma that disables them as well.

---
 arch/arm64/include/asm/neon-intrinsics.h |   24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

arch/arm64/include/asm/neon-intrinsics.h

Quoted 1 line
arch/arm64/include/asm/neon-intrinsics.h +0 -0
...

This cannot go to 6.18 without an adaptation of

14e346032143 ("xor: arm/arm64: Move NEON xor_gen() dispatch into the glue code")

for arch/arm64/lib/xor-neon.c; otherwise, the build just breaks in a different way for everyone:

In file included from arch/arm64/lib/xor-neon.c:11:
In file included from arch/arm64/include/asm/neon-intrinsics.h:23:
In file included from .../lib/clang/24/include/arm_neon.h:33:
.../lib/clang/24/include/stdint.h:100:24: error: typedef redefinition with different types ('long' vs 's64' (aka 'long long'))

    100 | typedef __INT64_TYPE__ int64_t;
        |                        ^
  include/linux/types.h:116:15: note: previous definition is here
    116 | typedef s64                     int64_t;
        |                                 ^
  In file included from arch/arm64/lib/xor-neon.c:11:
  In file included from arch/arm64/include/asm/neon-intrinsics.h:23:
  In file included from .../lib/clang/24/include/arm_neon.h:33:
  .../lib/clang/24/include/stdint.h:102:25: error: typedef redefinition with different types ('unsigned long' vs 'u64' (aka 'unsigned long long'))
    102 | typedef __UINT64_TYPE__ uint64_t;
        |                         ^
  include/linux/types.h:114:15: note: previous definition is here
    114 | typedef u64                     uint64_t;
        |                                 ^
Quoted 2 lines

Ard, I guess that would be something like this for 6.18 at least? I don't mind sending full patches if it looks right.

Whoops, that one had modpost problems (didn't let my build finish before sending...), this one should be better.

arch/arm64/lib/Makefile +2 -1
index a74507503a4a..a1c831386789 100644
@@ -10,7 +10,8 @@ lib-y		:= clear_user.o delay.o copy_from_user.o		\
 		   strnlen.o strchr.o strrchr.o tishift.o
 
 ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
-obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon.o
+obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon-arm64.o
+xor-neon-arm64-y := xor-neon-init.o xor-neon.o
 CFLAGS_xor-neon.o		+= $(CC_FLAGS_FPU)
 CFLAGS_REMOVE_xor-neon.o	+= $(CC_FLAGS_NO_FPU)
 endif
arch/arm64/lib/xor-neon-init.c new file +40 -0
new file mode 100644
index 000000000000..ca201b17cb39
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * arch/arm64/lib/xor-neon-init.c
+ *
+ * Authors: Jackie Liu <[email protected]>
+ * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
+ */
+
+#include <linux/raid/xor.h>
+#include <linux/module.h>
+#include "xor-neon.h"
+
+struct xor_block_template xor_block_inner_neon __ro_after_init = {
+	.name	= "__inner_neon__",
+	.do_2	= xor_arm64_neon_2,
+	.do_3	= xor_arm64_neon_3,
+	.do_4	= xor_arm64_neon_4,
+	.do_5	= xor_arm64_neon_5,
+};
+EXPORT_SYMBOL(xor_block_inner_neon);
+
+static int __init xor_neon_init(void)
+{
+	if (cpu_have_named_feature(SHA3)) {
+		xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
+		xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
+		xor_block_inner_neon.do_5 = xor_arm64_eor3_5;
+	}
+	return 0;
+}
+module_init(xor_neon_init);
+
+static void __exit xor_neon_exit(void)
+{
+}
+module_exit(xor_neon_exit);
+
+MODULE_AUTHOR("Jackie Liu <[email protected]>");
+MODULE_DESCRIPTION("ARMv8 XOR Extensions");
+MODULE_LICENSE("GPL");
arch/arm64/lib/xor-neon.c +8 -38
index 8fffebfa17b2..34ca063b7aa0 100644
@@ -6,11 +6,10 @@
  * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
  */
 
-#include <linux/raid/xor.h>
-#include <linux/module.h>
 #include <asm/neon-intrinsics.h>
+#include "xor-neon.h"
 
-static void xor_arm64_neon_2(unsigned long bytes, unsigned long * __restrict p1,
+void xor_arm64_neon_2(unsigned long bytes, unsigned long * __restrict p1,
 	const unsigned long * __restrict p2)
 {
 	uint64_t *dp1 = (uint64_t *)p1;
@@ -37,7 +36,7 @@ static void xor_arm64_neon_2(unsigned long bytes, unsigned long * __restrict p1,
 	} while (--lines > 0);
 }
 
-static void xor_arm64_neon_3(unsigned long bytes, unsigned long * __restrict p1,
+void xor_arm64_neon_3(unsigned long bytes, unsigned long * __restrict p1,
 	const unsigned long * __restrict p2,
 	const unsigned long * __restrict p3)
 {
@@ -73,7 +72,7 @@ static void xor_arm64_neon_3(unsigned long bytes, unsigned long * __restrict p1,
 	} while (--lines > 0);
 }
 
-static void xor_arm64_neon_4(unsigned long bytes, unsigned long * __restrict p1,
+void xor_arm64_neon_4(unsigned long bytes, unsigned long * __restrict p1,
 	const unsigned long * __restrict p2,
 	const unsigned long * __restrict p3,
 	const unsigned long * __restrict p4)
@@ -118,7 +117,7 @@ static void xor_arm64_neon_4(unsigned long bytes, unsigned long * __restrict p1,
 	} while (--lines > 0);
 }
 
-static void xor_arm64_neon_5(unsigned long bytes, unsigned long * __restrict p1,
+void xor_arm64_neon_5(unsigned long bytes, unsigned long * __restrict p1,
 	const unsigned long * __restrict p2,
 	const unsigned long * __restrict p3,
 	const unsigned long * __restrict p4,
@@ -172,15 +171,6 @@ static void xor_arm64_neon_5(unsigned long bytes, unsigned long * __restrict p1,
 	} while (--lines > 0);
 }
 
-struct xor_block_template xor_block_inner_neon __ro_after_init = {
-	.name	= "__inner_neon__",
-	.do_2	= xor_arm64_neon_2,
-	.do_3	= xor_arm64_neon_3,
-	.do_4	= xor_arm64_neon_4,
-	.do_5	= xor_arm64_neon_5,
-};
-EXPORT_SYMBOL(xor_block_inner_neon);
-
 static inline uint64x2_t eor3(uint64x2_t p, uint64x2_t q, uint64x2_t r)
 {
 	uint64x2_t res;
@@ -191,7 +181,7 @@ static inline uint64x2_t eor3(uint64x2_t p, uint64x2_t q, uint64x2_t r)
 	return res;
 }
 
-static void xor_arm64_eor3_3(unsigned long bytes,
+void xor_arm64_eor3_3(unsigned long bytes,
 	unsigned long * __restrict p1,
 	const unsigned long * __restrict p2,
 	const unsigned long * __restrict p3)
@@ -226,7 +216,7 @@ static void xor_arm64_eor3_3(unsigned long bytes,
 	} while (--lines > 0);
 }
 
-static void xor_arm64_eor3_4(unsigned long bytes,
+void xor_arm64_eor3_4(unsigned long bytes,
 	unsigned long * __restrict p1,
 	const unsigned long * __restrict p2,
 	const unsigned long * __restrict p3,
@@ -270,7 +260,7 @@ static void xor_arm64_eor3_4(unsigned long bytes,
 	} while (--lines > 0);
 }
 
-static void xor_arm64_eor3_5(unsigned long bytes,
+void xor_arm64_eor3_5(unsigned long bytes,
 	unsigned long * __restrict p1,
 	const unsigned long * __restrict p2,
 	const unsigned long * __restrict p3,
@@ -316,23 +306,3 @@ static void xor_arm64_eor3_5(unsigned long bytes,
 		dp5 += 8;
 	} while (--lines > 0);
 }
-
-static int __init xor_neon_init(void)
-{
-	if (cpu_have_named_feature(SHA3)) {
-		xor_block_inner_neon.do_3 = xor_arm64_eor3_3;
-		xor_block_inner_neon.do_4 = xor_arm64_eor3_4;
-		xor_block_inner_neon.do_5 = xor_arm64_eor3_5;
-	}
-	return 0;
-}
-module_init(xor_neon_init);
-
-static void __exit xor_neon_exit(void)
-{
-}
-module_exit(xor_neon_exit);
-
-MODULE_AUTHOR("Jackie Liu <[email protected]>");
-MODULE_DESCRIPTION("ARMv8 XOR Extensions");
-MODULE_LICENSE("GPL");
arch/arm64/lib/xor-neon.h new file +27 -0
new file mode 100644
index 000000000000..f0a30af1ef33
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * arch/arm64/lib/xor-neon.h
+ *
+ * Authors: Jackie Liu <[email protected]>
+ * Copyright (C) 2018,Tianjin KYLIN Information Technology Co., Ltd.
+ */
+
+void xor_arm64_neon_2(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2);
+void xor_arm64_neon_3(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3);
+void xor_arm64_neon_4(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4);
+void xor_arm64_neon_5(unsigned long bytes, unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4,
+	const unsigned long * __restrict p5);
+void xor_arm64_eor3_3(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3);
+void xor_arm64_eor3_4(unsigned long bytes,

arch/arm64/lib/xor-neon.h line 37

Quoted 10 lines
arch/arm64/lib/xor-neon.h new file +10 -0
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4);
+void xor_arm64_eor3_5(unsigned long bytes,
+	unsigned long * __restrict p1,
+	const unsigned long * __restrict p2,
+	const unsigned long * __restrict p3,
+	const unsigned long * __restrict p4,
+	const unsigned long * __restrict p5);

I've dropped this from 6.18 and older queues now. If you could send a series that adds this properly for those trees, I'll be glad to take them.

thanks,

greg k-h