]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Mar 2026 13:46:05 +0000 (14:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Mar 2026 13:46:05 +0000 (14:46 +0100)
added patches:
arm-clean-up-the-memset64-c-wrapper.patch

queue-6.6/arm-clean-up-the-memset64-c-wrapper.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/arm-clean-up-the-memset64-c-wrapper.patch b/queue-6.6/arm-clean-up-the-memset64-c-wrapper.patch
new file mode 100644 (file)
index 0000000..25c32a5
--- /dev/null
@@ -0,0 +1,57 @@
+From b52343d1cb47bb27ca32a3f4952cc2fd3cd165bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas.weissschuh@linutronix.de>
+Date: Fri, 13 Feb 2026 08:39:29 +0100
+Subject: ARM: clean up the memset64() C wrapper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
+
+commit b52343d1cb47bb27ca32a3f4952cc2fd3cd165bf upstream.
+
+The current logic to split the 64-bit argument into its 32-bit halves is
+byte-order specific and a bit clunky.  Use a union instead which is
+easier to read and works in all cases.
+
+GCC still generates the same machine code.
+
+While at it, rename the arguments of the __memset64() prototype to
+actually reflect their semantics.
+
+Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Reported-by: Ben Hutchings <ben@decadent.org.uk> # for -stable
+Link: https://lore.kernel.org/all/1a11526ae3d8664f705b541b8d6ea57b847b49a8.camel@decadent.org.uk/
+Suggested-by: https://lore.kernel.org/all/aZonkWMwpbFhzDJq@casper.infradead.org/ # for -stable
+Link: https://lore.kernel.org/all/aZonkWMwpbFhzDJq@casper.infradead.org/
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arm/include/asm/string.h |   14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+--- a/arch/arm/include/asm/string.h
++++ b/arch/arm/include/asm/string.h
+@@ -39,13 +39,17 @@ static inline void *memset32(uint32_t *p
+ }
+ #define __HAVE_ARCH_MEMSET64
+-extern void *__memset64(uint64_t *, uint32_t low, __kernel_size_t, uint32_t hi);
++extern void *__memset64(uint64_t *, uint32_t first, __kernel_size_t, uint32_t second);
+ static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)
+ {
+-      if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
+-              return __memset64(p, v, n * 8, v >> 32);
+-      else
+-              return __memset64(p, v >> 32, n * 8, v);
++      union {
++              uint64_t val;
++              struct {
++                      uint32_t first, second;
++              };
++      } word = { .val = v };
++
++      return __memset64(p, word.first, n * 8, word.second);
+ }
+ /*
index 0f5da579f2eda9c5632540e5d38104e3f9860981..985a17b15134232a3e654d118889030b8c13bd88 100644 (file)
@@ -121,3 +121,4 @@ smb-client-don-t-log-plaintext-credentials-in-cifs_set_cifscreds.patch
 scsi-core-fix-refcount-leak-for-tagset_refcnt.patch
 selftests-mptcp-more-stable-simult_flows-tests.patch
 selftests-mptcp-join-check-removing-signal-subflow-endp.patch
+arm-clean-up-the-memset64-c-wrapper.patch