linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Switch get/put unaligned to use memcpy
@ 2025-06-26  5:48 Ian Rogers
  2025-06-26  5:48 ` [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy Ian Rogers
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ian Rogers @ 2025-06-26  5:48 UTC (permalink / raw)
  To: Eric Biggers, Yuzhuo Jing, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: Ian Rogers

The existing type punning approach with packed structs requires
 -fno-strict-aliasing to be passed to the compiler for
correctness. This is true in the kernel tree but not in the tools
directory resulting in this suggested patch from Eric Biggers
 <ebiggers@google.com>:
https://lore.kernel.org/lkml/20250625202311.23244-2-ebiggers@kernel.org/

Requiring -fno-strict-aliasing seems unfortunate and so this patch
makes the unaligned code work via memcpy for type punning rather than
the packed attribute.

v3: switch to __unqual_scalar_typeof, reducing the code, and use an
    uninitialized variable rather than a cast of 0 to try to avoid a
    sparse warning about not using NULL. The code is trying to
    navigate a minefield of uninitialized and casting warnings,
    hopefully the best balance has been struck, but the code will fail
    for cases like:
    const void *val = get_unaligned((const void * const *)ptr);
    due to __unqual_scalar_typeof leaving the 2nd const of the cast in
    place. Thankfully no code does this - tested with an
    allyesconfig. Support would be achievable by using void* as a
    default case in __unqual_scalar_typeof, it just doesn't seem worth
    it for a fairly unusual const case.

v2: switch memcpy to __builtin_memcpy to avoid potential/disallowed
    memcpy calls in vdso caused by -fno-builtin. Reported by
    Christophe Leroy <christophe.leroy@csgroup.eu>:
    https://lore.kernel.org/lkml/c57de5bf-d55c-48c5-9dfa-e2fb844dafe9@csgroup.eu/

Ian Rogers (3):
  vdso: Switch get/put unaligned from packed struct to memcpy
  tools headers: Update the linux/unaligned.h copy with the kernel
    sources
  tools headers: Remove unneeded ignoring of warnings in unaligned.h

 include/vdso/unaligned.h             | 39 +++++++++++++++++++++++-----
 tools/include/linux/compiler_types.h | 22 ++++++++++++++++
 tools/include/linux/unaligned.h      |  4 ---
 tools/include/vdso/unaligned.h       | 39 +++++++++++++++++++++++-----
 4 files changed, 88 insertions(+), 16 deletions(-)

-- 
2.50.0.727.gbf7dc18ff4-goog


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-06-26  5:48 [PATCH v3 0/3] Switch get/put unaligned to use memcpy Ian Rogers
@ 2025-06-26  5:48 ` Ian Rogers
  2025-06-27  7:58   ` kernel test robot
  2025-07-05  0:05   ` kernel test robot
  2025-06-26  5:48 ` [PATCH v3 2/3] tools headers: Update the linux/unaligned.h copy with the kernel sources Ian Rogers
  2025-06-26  5:48 ` [PATCH v3 3/3] tools headers: Remove unneeded ignoring of warnings in unaligned.h Ian Rogers
  2 siblings, 2 replies; 11+ messages in thread
From: Ian Rogers @ 2025-06-26  5:48 UTC (permalink / raw)
  To: Eric Biggers, Yuzhuo Jing, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: Ian Rogers

Type punning is necessary for get/put unaligned but the use of a
packed struct violates strict aliasing rules, requiring
-fno-strict-aliasing to be passed to the C compiler. Switch to using
memcpy so that -fno-strict-aliasing isn't necessary.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 include/vdso/unaligned.h | 39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/include/vdso/unaligned.h b/include/vdso/unaligned.h
index ff0c06b6513e..0ccbcc9aa493 100644
--- a/include/vdso/unaligned.h
+++ b/include/vdso/unaligned.h
@@ -2,14 +2,41 @@
 #ifndef __VDSO_UNALIGNED_H
 #define __VDSO_UNALIGNED_H
 
-#define __get_unaligned_t(type, ptr) ({							\
-	const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr);	\
-	__get_pptr->x;									\
+#include <linux/compiler_types.h>
+
+/**
+ * __get_unaligned_t - read an unaligned value from memory.
+ * @type:	the type to load from the pointer.
+ * @ptr:	the pointer to load from.
+ *
+ * Use memcpy to affect an unaligned type sized load avoiding undefined behavior
+ * from approaches like type punning that require -fno-strict-aliasing in order
+ * to be correct. As type may be const, use __unqual_scalar_typeof to map to a
+ * non-const type - you can't memcpy into a const type. The void* cast silences
+ * ubsan warnings.
+ */
+#define __get_unaligned_t(type, ptr) ({					\
+	type __get_unaligned_ctrl_type __always_unused;			\
+	__unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val; \
+	__builtin_memcpy(&__get_unaligned_val, (void *)(ptr),		\
+			 sizeof(__get_unaligned_val));			\
+	__get_unaligned_val;						\
 })
 
-#define __put_unaligned_t(type, val, ptr) do {						\
-	struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr);		\
-	__put_pptr->x = (val);								\
+/**
+ * __put_unaligned_t - write an unaligned value to memory.
+ * @type:	the type of the value to store.
+ * @val:	the value to store.
+ * @ptr:	the pointer to store to.
+ *
+ * Use memcpy to affect an unaligned type sized store avoiding undefined
+ * behavior from approaches like type punning that require -fno-strict-aliasing
+ * in order to be correct. The void* cast silences ubsan warnings.
+ */
+#define __put_unaligned_t(type, val, ptr) do {				\
+	type __put_unaligned_val = (val);				\
+	__builtin_memcpy((void *)(ptr), &__put_unaligned_val,		\
+			 sizeof(__put_unaligned_val));			\
 } while (0)
 
 #endif /* __VDSO_UNALIGNED_H */
-- 
2.50.0.727.gbf7dc18ff4-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 2/3] tools headers: Update the linux/unaligned.h copy with the kernel sources
  2025-06-26  5:48 [PATCH v3 0/3] Switch get/put unaligned to use memcpy Ian Rogers
  2025-06-26  5:48 ` [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy Ian Rogers
@ 2025-06-26  5:48 ` Ian Rogers
  2025-06-26  5:48 ` [PATCH v3 3/3] tools headers: Remove unneeded ignoring of warnings in unaligned.h Ian Rogers
  2 siblings, 0 replies; 11+ messages in thread
From: Ian Rogers @ 2025-06-26  5:48 UTC (permalink / raw)
  To: Eric Biggers, Yuzhuo Jing, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: Ian Rogers

To pick up the changes in:

  fe9b2b7b3583 vdso: Switch get/put unaligned from packed struct to memcpy

As the code is dependent on __unqual_scalar_typeof, update the tools
version of compiler_types.h to include this.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/include/linux/compiler_types.h | 22 ++++++++++++++++
 tools/include/vdso/unaligned.h       | 39 +++++++++++++++++++++++-----
 2 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/tools/include/linux/compiler_types.h b/tools/include/linux/compiler_types.h
index d09f9dc172a4..890982283a5e 100644
--- a/tools/include/linux/compiler_types.h
+++ b/tools/include/linux/compiler_types.h
@@ -40,4 +40,26 @@
 #define asm_goto_output(x...) asm goto(x)
 #endif
 
+/*
+ * __unqual_scalar_typeof(x) - Declare an unqualified scalar type, leaving
+ *			       non-scalar types unchanged.
+ */
+/*
+ * Prefer C11 _Generic for better compile-times and simpler code. Note: 'char'
+ * is not type-compatible with 'signed char', and we define a separate case.
+ */
+#define __scalar_type_to_expr_cases(type)				\
+		unsigned type:	(unsigned type)0,			\
+		signed type:	(signed type)0
+
+#define __unqual_scalar_typeof(x) typeof(				\
+		_Generic((x),						\
+			 char:	(char)0,				\
+			 __scalar_type_to_expr_cases(char),		\
+			 __scalar_type_to_expr_cases(short),		\
+			 __scalar_type_to_expr_cases(int),		\
+			 __scalar_type_to_expr_cases(long),		\
+			 __scalar_type_to_expr_cases(long long),	\
+			 default: (x)))
+
 #endif /* __LINUX_COMPILER_TYPES_H */
diff --git a/tools/include/vdso/unaligned.h b/tools/include/vdso/unaligned.h
index ff0c06b6513e..0ccbcc9aa493 100644
--- a/tools/include/vdso/unaligned.h
+++ b/tools/include/vdso/unaligned.h
@@ -2,14 +2,41 @@
 #ifndef __VDSO_UNALIGNED_H
 #define __VDSO_UNALIGNED_H
 
-#define __get_unaligned_t(type, ptr) ({							\
-	const struct { type x; } __packed * __get_pptr = (typeof(__get_pptr))(ptr);	\
-	__get_pptr->x;									\
+#include <linux/compiler_types.h>
+
+/**
+ * __get_unaligned_t - read an unaligned value from memory.
+ * @type:	the type to load from the pointer.
+ * @ptr:	the pointer to load from.
+ *
+ * Use memcpy to affect an unaligned type sized load avoiding undefined behavior
+ * from approaches like type punning that require -fno-strict-aliasing in order
+ * to be correct. As type may be const, use __unqual_scalar_typeof to map to a
+ * non-const type - you can't memcpy into a const type. The void* cast silences
+ * ubsan warnings.
+ */
+#define __get_unaligned_t(type, ptr) ({					\
+	type __get_unaligned_ctrl_type __always_unused;			\
+	__unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val; \
+	__builtin_memcpy(&__get_unaligned_val, (void *)(ptr),		\
+			 sizeof(__get_unaligned_val));			\
+	__get_unaligned_val;						\
 })
 
-#define __put_unaligned_t(type, val, ptr) do {						\
-	struct { type x; } __packed * __put_pptr = (typeof(__put_pptr))(ptr);		\
-	__put_pptr->x = (val);								\
+/**
+ * __put_unaligned_t - write an unaligned value to memory.
+ * @type:	the type of the value to store.
+ * @val:	the value to store.
+ * @ptr:	the pointer to store to.
+ *
+ * Use memcpy to affect an unaligned type sized store avoiding undefined
+ * behavior from approaches like type punning that require -fno-strict-aliasing
+ * in order to be correct. The void* cast silences ubsan warnings.
+ */
+#define __put_unaligned_t(type, val, ptr) do {				\
+	type __put_unaligned_val = (val);				\
+	__builtin_memcpy((void *)(ptr), &__put_unaligned_val,		\
+			 sizeof(__put_unaligned_val));			\
 } while (0)
 
 #endif /* __VDSO_UNALIGNED_H */
-- 
2.50.0.727.gbf7dc18ff4-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v3 3/3] tools headers: Remove unneeded ignoring of warnings in unaligned.h
  2025-06-26  5:48 [PATCH v3 0/3] Switch get/put unaligned to use memcpy Ian Rogers
  2025-06-26  5:48 ` [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy Ian Rogers
  2025-06-26  5:48 ` [PATCH v3 2/3] tools headers: Update the linux/unaligned.h copy with the kernel sources Ian Rogers
@ 2025-06-26  5:48 ` Ian Rogers
  2 siblings, 0 replies; 11+ messages in thread
From: Ian Rogers @ 2025-06-26  5:48 UTC (permalink / raw)
  To: Eric Biggers, Yuzhuo Jing, Andy Lutomirski, Thomas Gleixner,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: Ian Rogers

Now the get/put unaligned use memcpy the -Wpacked and -Wattributes
warnings don't need disabling.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/include/linux/unaligned.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/include/linux/unaligned.h b/tools/include/linux/unaligned.h
index 395a4464fe73..d51ddafed138 100644
--- a/tools/include/linux/unaligned.h
+++ b/tools/include/linux/unaligned.h
@@ -6,9 +6,6 @@
  * This is the most generic implementation of unaligned accesses
  * and should work almost anywhere.
  */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpacked"
-#pragma GCC diagnostic ignored "-Wattributes"
 #include <vdso/unaligned.h>
 
 #define get_unaligned(ptr)	__get_unaligned_t(typeof(*(ptr)), (ptr))
@@ -143,6 +140,5 @@ static inline u64 get_unaligned_be48(const void *p)
 {
 	return __get_unaligned_be48(p);
 }
-#pragma GCC diagnostic pop
 
 #endif /* __LINUX_UNALIGNED_H */
-- 
2.50.0.727.gbf7dc18ff4-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-06-26  5:48 ` [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy Ian Rogers
@ 2025-06-27  7:58   ` kernel test robot
  2025-07-05  0:05   ` kernel test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-06-27  7:58 UTC (permalink / raw)
  To: Ian Rogers, Eric Biggers, Yuzhuo Jing, Andy Lutomirski,
	Thomas Gleixner, Vincenzo Frascino, Arnaldo Carvalho de Melo,
	Al Viro, Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: oe-kbuild-all, Ian Rogers

Hi Ian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.16-rc3 next-20250626]
[cannot apply to tip/timers/vdso acme/perf/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/vdso-Switch-get-put-unaligned-from-packed-struct-to-memcpy/20250626-135005
base:   linus/master
patch link:    https://lore.kernel.org/r/20250626054826.433453-2-irogers%40google.com
patch subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
config: nios2-randconfig-r111-20250627 (https://download.01.org/0day-ci/archive/20250627/202506271501.X7apmMDK-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 8.5.0
reproduce: (https://download.01.org/0day-ci/archive/20250627/202506271501.X7apmMDK-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506271501.X7apmMDK-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   drivers/infiniband/core/cm.c: note: in included file (through include/rdma/ibta_vol1_c12.h, drivers/infiniband/core/cm_msgs.h):
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
   drivers/infiniband/core/cm.c: note: in included file (through include/uapi/linux/swab.h, include/linux/swab.h, include/uapi/linux/byteorder/little_endian.h, ...):
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   drivers/infiniband/core/cm.c: note: in included file (through include/rdma/ibta_vol1_c12.h, drivers/infiniband/core/cm_msgs.h):
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
   drivers/infiniband/core/cm.c: note: in included file (through include/uapi/linux/swab.h, include/linux/swab.h, include/uapi/linux/byteorder/little_endian.h, ...):
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   drivers/infiniband/core/cm.c: note: in included file (through include/rdma/ibta_vol1_c12.h, drivers/infiniband/core/cm_msgs.h):
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
   drivers/infiniband/core/cm.c: note: in included file (through include/uapi/linux/swab.h, include/linux/swab.h, include/uapi/linux/byteorder/little_endian.h, ...):
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   drivers/infiniband/core/cm.c: note: in included file (through include/rdma/ibta_vol1_c12.h, drivers/infiniband/core/cm_msgs.h):
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
>> include/rdma/iba.h:48:16: sparse: sparse: incorrect type in argument 1 (different modifiers) @@     expected void * @@     got restricted __be64 const * @@
   include/rdma/iba.h:48:16: sparse:     expected void *
   include/rdma/iba.h:48:16: sparse:     got restricted __be64 const *
   drivers/infiniband/core/cm.c: note: in included file (through include/uapi/linux/swab.h, include/linux/swab.h, include/uapi/linux/byteorder/little_endian.h, ...):
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:31:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini
   arch/nios2/include/uapi/asm/swab.h:25:24: sparse: sparse: too many arguments for function __builtin_custom_ini

vim +48 include/rdma/iba.h

d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  41  
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  42  static inline u64 _iba_get64(const __be64 *ptr)
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  43  {
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  44  	/*
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  45  	 * The mads are constructed so that 32 bit and smaller are naturally
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  46  	 * aligned, everything larger has a max alignment of 4 bytes.
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  47  	 */
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16 @48  	return be64_to_cpu(get_unaligned(ptr));
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  49  }
d05d4ac4c9316a2 Leon Romanovsky 2020-01-16  50  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-06-26  5:48 ` [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy Ian Rogers
  2025-06-27  7:58   ` kernel test robot
@ 2025-07-05  0:05   ` kernel test robot
  2025-07-22 15:56     ` Thomas Gleixner
  1 sibling, 1 reply; 11+ messages in thread
From: kernel test robot @ 2025-07-05  0:05 UTC (permalink / raw)
  To: Ian Rogers, Eric Biggers, Yuzhuo Jing, Andy Lutomirski,
	Thomas Gleixner, Vincenzo Frascino, Arnaldo Carvalho de Melo,
	Al Viro, Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: llvm, oe-kbuild-all, Ian Rogers

Hi Ian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on tip/timers/vdso v6.16-rc4 next-20250704]
[cannot apply to acme/perf/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/vdso-Switch-get-put-unaligned-from-packed-struct-to-memcpy/20250626-135005
base:   linus/master
patch link:    https://lore.kernel.org/r/20250626054826.433453-2-irogers%40google.com
patch subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
config: s390-randconfig-002-20250705 (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507050736.b4hX0Xks-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/s390/boot/decompressor.c:48:
   In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
   In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:109:9: warning: default initialization of an object of type 'typeof (*((const U16 *)ptr))' (aka 'const unsigned short') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
     109 |         return get_unaligned((const U16 *)ptr);
         |                ^
   include/linux/unaligned.h:13:28: note: expanded from macro 'get_unaligned'
      13 | #define get_unaligned(ptr)      __get_unaligned_t(typeof(*(ptr)), (ptr))
         |                                 ^
   include/vdso/unaligned.h:19:7: note: expanded from macro '__get_unaligned_t'
      19 |         type __get_unaligned_ctrl_type __always_unused;                 \
         |              ^
   In file included from arch/s390/boot/decompressor.c:48:
   In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
   In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:114:9: warning: default initialization of an object of type 'typeof (*((const U32 *)ptr))' (aka 'const unsigned int') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
     114 |         return get_unaligned((const U32 *)ptr);
         |                ^
   include/linux/unaligned.h:13:28: note: expanded from macro 'get_unaligned'
      13 | #define get_unaligned(ptr)      __get_unaligned_t(typeof(*(ptr)), (ptr))
         |                                 ^
   include/vdso/unaligned.h:19:7: note: expanded from macro '__get_unaligned_t'
      19 |         type __get_unaligned_ctrl_type __always_unused;                 \
         |              ^
   In file included from arch/s390/boot/decompressor.c:48:
   In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
   In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:119:9: warning: default initialization of an object of type 'typeof (*((const size_t *)ptr))' (aka 'const unsigned long') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
     119 |         return get_unaligned((const size_t *)ptr);
         |                ^
   include/linux/unaligned.h:13:28: note: expanded from macro 'get_unaligned'
      13 | #define get_unaligned(ptr)      __get_unaligned_t(typeof(*(ptr)), (ptr))
         |                                 ^
   include/vdso/unaligned.h:19:7: note: expanded from macro '__get_unaligned_t'
      19 |         type __get_unaligned_ctrl_type __always_unused;                 \
         |              ^
   In file included from arch/s390/boot/decompressor.c:48:
   In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
   In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:156:10: warning: default initialization of an object of type 'typeof (*((const U64 *)src))' (aka 'const unsigned long long') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
     156 |         U64 a = get_unaligned((const U64 *)src);
         |                 ^
   include/linux/unaligned.h:13:28: note: expanded from macro 'get_unaligned'
      13 | #define get_unaligned(ptr)      __get_unaligned_t(typeof(*(ptr)), (ptr))
         |                                 ^
   include/vdso/unaligned.h:19:7: note: expanded from macro '__get_unaligned_t'
      19 |         type __get_unaligned_ctrl_type __always_unused;                 \
         |              ^
   In file included from arch/s390/boot/decompressor.c:48:
   arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:160:29: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
     160 |                 ret = LZ4_decompress_fast(inp, outp, dest_len);
         |                                           ^~~
   arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:477:37: note: passing argument to parameter 'source' here
     477 | int LZ4_decompress_fast(const char *source, char *dest, int originalSize)
         |                                     ^
   In file included from arch/s390/boot/decompressor.c:48:
   arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:160:34: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
     160 |                 ret = LZ4_decompress_fast(inp, outp, dest_len);
         |                                                ^~~~
   arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:477:51: note: passing argument to parameter 'dest' here
     477 | int LZ4_decompress_fast(const char *source, char *dest, int originalSize)
         |                                                   ^
   6 warnings generated.


vim +109 arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h

4e1a33b105ddf2 Sven Schmidt 2017-02-24  103  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  104  /*-************************************
4e1a33b105ddf2 Sven Schmidt 2017-02-24  105   *	Reading and writing into memory
4e1a33b105ddf2 Sven Schmidt 2017-02-24  106   **************************************/
4e1a33b105ddf2 Sven Schmidt 2017-02-24  107  static FORCE_INLINE U16 LZ4_read16(const void *ptr)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  108  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24 @109  	return get_unaligned((const U16 *)ptr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  110  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  111  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  112  static FORCE_INLINE U32 LZ4_read32(const void *ptr)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  113  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24 @114  	return get_unaligned((const U32 *)ptr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  115  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  116  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  117  static FORCE_INLINE size_t LZ4_read_ARCH(const void *ptr)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  118  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24 @119  	return get_unaligned((const size_t *)ptr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  120  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  121  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  122  static FORCE_INLINE void LZ4_write16(void *memPtr, U16 value)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  123  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24  124  	put_unaligned(value, (U16 *)memPtr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  125  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  126  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  127  static FORCE_INLINE void LZ4_write32(void *memPtr, U32 value)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  128  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24  129  	put_unaligned(value, (U32 *)memPtr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  130  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  131  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  132  static FORCE_INLINE U16 LZ4_readLE16(const void *memPtr)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  133  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24  134  	return get_unaligned_le16(memPtr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  135  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  136  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  137  static FORCE_INLINE void LZ4_writeLE16(void *memPtr, U16 value)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  138  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24  139  	return put_unaligned_le16(value, memPtr);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  140  }
4e1a33b105ddf2 Sven Schmidt 2017-02-24  141  
b1a3e75e466d96 Nick Terrell 2020-08-14  142  /*
b1a3e75e466d96 Nick Terrell 2020-08-14  143   * LZ4 relies on memcpy with a constant size being inlined. In freestanding
b1a3e75e466d96 Nick Terrell 2020-08-14  144   * environments, the compiler can't assume the implementation of memcpy() is
b1a3e75e466d96 Nick Terrell 2020-08-14  145   * standard compliant, so apply its specialized memcpy() inlining logic. When
b1a3e75e466d96 Nick Terrell 2020-08-14  146   * possible, use __builtin_memcpy() to tell the compiler to analyze memcpy()
b1a3e75e466d96 Nick Terrell 2020-08-14  147   * as-if it were standard compliant, so it can inline it in freestanding
b1a3e75e466d96 Nick Terrell 2020-08-14  148   * environments. This is needed when decompressing the Linux Kernel, for example.
b1a3e75e466d96 Nick Terrell 2020-08-14  149   */
b1a3e75e466d96 Nick Terrell 2020-08-14  150  #define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
89b158635ad795 Gao Xiang    2020-12-15  151  #define LZ4_memmove(dst, src, size) __builtin_memmove(dst, src, size)
b1a3e75e466d96 Nick Terrell 2020-08-14  152  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  153  static FORCE_INLINE void LZ4_copy8(void *dst, const void *src)
4e1a33b105ddf2 Sven Schmidt 2017-02-24  154  {
4e1a33b105ddf2 Sven Schmidt 2017-02-24  155  #if LZ4_ARCH64
4e1a33b105ddf2 Sven Schmidt 2017-02-24 @156  	U64 a = get_unaligned((const U64 *)src);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  157  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  158  	put_unaligned(a, (U64 *)dst);
c72ac7a1a926db Chanho Min   2013-07-08  159  #else
4e1a33b105ddf2 Sven Schmidt 2017-02-24  160  	U32 a = get_unaligned((const U32 *)src);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  161  	U32 b = get_unaligned((const U32 *)src + 1);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  162  
4e1a33b105ddf2 Sven Schmidt 2017-02-24  163  	put_unaligned(a, (U32 *)dst);
4e1a33b105ddf2 Sven Schmidt 2017-02-24  164  	put_unaligned(b, (U32 *)dst + 1);
c72ac7a1a926db Chanho Min   2013-07-08  165  #endif
4e1a33b105ddf2 Sven Schmidt 2017-02-24  166  }
cffb78b0e0b3a3 Kyungsik Lee 2013-07-08  167  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-07-05  0:05   ` kernel test robot
@ 2025-07-22 15:56     ` Thomas Gleixner
  2025-07-22 16:44       ` Ian Rogers
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Gleixner @ 2025-07-22 15:56 UTC (permalink / raw)
  To: kernel test robot, Ian Rogers, Eric Biggers, Yuzhuo Jing,
	Andy Lutomirski, Vincenzo Frascino, Arnaldo Carvalho de Melo,
	Al Viro, Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users
  Cc: llvm, oe-kbuild-all, Ian Rogers

Ian!

On Sat, Jul 05 2025 at 08:05, kernel test robot wrote:
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on linus/master]
> [also build test WARNING on tip/timers/vdso v6.16-rc4 next-20250704]
> [cannot apply to acme/perf/core]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/vdso-Switch-get-put-unaligned-from-packed-struct-to-memcpy/20250626-135005
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20250626054826.433453-2-irogers%40google.com
> patch subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
> config: s390-randconfig-002-20250705 (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/config)
> compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202507050736.b4hX0Xks-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
>    In file included from arch/s390/boot/decompressor.c:48:
>    In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
>    In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
>>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:109:9: warning: default initialization of an object of type 'typeof (*((const U16 *)ptr))' (aka 'const unsigned short') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
>      109 |         return get_unaligned((const U16 *)ptr);
>          |                ^

Any update on this one?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-07-22 15:56     ` Thomas Gleixner
@ 2025-07-22 16:44       ` Ian Rogers
  2025-07-22 17:00         ` Ian Rogers
  0 siblings, 1 reply; 11+ messages in thread
From: Ian Rogers @ 2025-07-22 16:44 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: kernel test robot, Eric Biggers, Yuzhuo Jing, Andy Lutomirski,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users, llvm, oe-kbuild-all

On Tue, Jul 22, 2025 at 8:56 AM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> Ian!
>
> On Sat, Jul 05 2025 at 08:05, kernel test robot wrote:
> > kernel test robot noticed the following build warnings:
> >
> > [auto build test WARNING on linus/master]
> > [also build test WARNING on tip/timers/vdso v6.16-rc4 next-20250704]
> > [cannot apply to acme/perf/core]
> > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > And when submitting patch, we suggest to use '--base' as documented in
> > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> >
> > url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/vdso-Switch-get-put-unaligned-from-packed-struct-to-memcpy/20250626-135005
> > base:   linus/master
> > patch link:    https://lore.kernel.org/r/20250626054826.433453-2-irogers%40google.com
> > patch subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
> > config: s390-randconfig-002-20250705 (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/config)
> > compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202507050736.b4hX0Xks-lkp@intel.com/
> >
> > All warnings (new ones prefixed by >>):
> >
> >    In file included from arch/s390/boot/decompressor.c:48:
> >    In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
> >    In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
> >>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:109:9: warning: default initialization of an object of type 'typeof (*((const U16 *)ptr))' (aka 'const unsigned short') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
> >      109 |         return get_unaligned((const U16 *)ptr);
> >          |                ^
>
> Any update on this one?

Hi Thomas!

Thanks for the interest. I'm not sure how to resolve this.
Basically the story in the code is:

  get_unaligned((const U16 *)ptr);

is being expanded by:

  #define get_unaligned(ptr)      __get_unaligned_t(typeof(*(ptr)), (ptr))
  #define __get_unaligned_t(type, ptr) ({
          \
       type __get_unaligned_ctrl_type __always_unused;                 \
       __unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val; \
       __builtin_memcpy(&__get_unaligned_val, (void *)(ptr),           \
                        sizeof(__get_unaligned_val));                  \
       __get_unaligned_val;                                            \
  })

to:

  ({
  const U16 __get_unaligned_ctrl_type __always_unused;
  __unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val;
  __builtin_memcpy(&__get_unaligned_val, (void *)(ptr),
   sizeof(__get_unaligned_val));
  __get_unaligned_val;
  })

which is then expanded to:

  ({
  const U16 __get_unaligned_ctrl_type __always_unused;
  U16 __get_unaligned_val;
  __builtin_memcpy(&__get_unaligned_val, (void *)(ptr),
   sizeof(__get_unaligned_val));
  __get_unaligned_val;
  })

so the analysis is correct that __get_unaligned_ctrl_type is
unused, however, I've also put __always_unused on the variable.
The purpose of that variable is for __unqual_scalar_typeof that
passes the value to _Generic. I truly don't care about that
variable but I care about it causing _Generic to get the correct
type for __get_unaligned_val (that value can't be const as it is
the destination of the memcpy). Why even declare
__get_unaligned_ctrl_type? Well we want the result of __get_unaligned_t to
match its type argument which needn't match the dereference of
its pointer argument (*ptr) - I accept that in many cases it
will. The value passed to _Generic is an expression and not a
type, so declaring the variable and using the variable for
_Generic allows this.

My feeling is that my patch is correct and I'm not clear how to
improve upon it. I believe it is a weakness in the analysis that
the __always_unused isn't having an effect.

Should adding new warnings for analysis on the code base be
allowed for this patch? Well the upside to the patch is getting
closer to not requiring -fno-strict-aliasing, or not introducing
requiring that flag for things in the tools directory. I think
the upside is good, I don't know how to mitigate the downside
with poor analysis by certain tools.

Thanks,
Ian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-07-22 16:44       ` Ian Rogers
@ 2025-07-22 17:00         ` Ian Rogers
  2025-07-23 22:14           ` David Laight
  2025-08-18 16:03           ` Ian Rogers
  0 siblings, 2 replies; 11+ messages in thread
From: Ian Rogers @ 2025-07-22 17:00 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: kernel test robot, Eric Biggers, Yuzhuo Jing, Andy Lutomirski,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users, llvm, oe-kbuild-all

On Tue, Jul 22, 2025 at 9:44 AM Ian Rogers <irogers@google.com> wrote:
>
> On Tue, Jul 22, 2025 at 8:56 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > Ian!
> >
> > On Sat, Jul 05 2025 at 08:05, kernel test robot wrote:
> > > kernel test robot noticed the following build warnings:
> > >
> > > [auto build test WARNING on linus/master]
> > > [also build test WARNING on tip/timers/vdso v6.16-rc4 next-20250704]
> > > [cannot apply to acme/perf/core]
> > > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > > And when submitting patch, we suggest to use '--base' as documented in
> > > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> > >
> > > url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/vdso-Switch-get-put-unaligned-from-packed-struct-to-memcpy/20250626-135005
> > > base:   linus/master
> > > patch link:    https://lore.kernel.org/r/20250626054826.433453-2-irogers%40google.com
> > > patch subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
> > > config: s390-randconfig-002-20250705 (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/config)
> > > compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202507050736.b4hX0Xks-lkp@intel.com/
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > >    In file included from arch/s390/boot/decompressor.c:48:
> > >    In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
> > >    In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
> > >>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:109:9: warning: default initialization of an object of type 'typeof (*((const U16 *)ptr))' (aka 'const unsigned short') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
> > >      109 |         return get_unaligned((const U16 *)ptr);
> > >          |                ^
> >
> > Any update on this one?
>
> Hi Thomas!
>
> Thanks for the interest. I'm not sure how to resolve this.
> Basically the story in the code is:
>
>   get_unaligned((const U16 *)ptr);
>
> is being expanded by:
>
>   #define get_unaligned(ptr)      __get_unaligned_t(typeof(*(ptr)), (ptr))
>   #define __get_unaligned_t(type, ptr) ({
>           \
>        type __get_unaligned_ctrl_type __always_unused;                 \
>        __unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val; \
>        __builtin_memcpy(&__get_unaligned_val, (void *)(ptr),           \
>                         sizeof(__get_unaligned_val));                  \
>        __get_unaligned_val;                                            \
>   })
>
> to:
>
>   ({
>   const U16 __get_unaligned_ctrl_type __always_unused;
>   __unqual_scalar_typeof(__get_unaligned_ctrl_type) __get_unaligned_val;
>   __builtin_memcpy(&__get_unaligned_val, (void *)(ptr),
>    sizeof(__get_unaligned_val));
>   __get_unaligned_val;
>   })
>
> which is then expanded to:
>
>   ({
>   const U16 __get_unaligned_ctrl_type __always_unused;
>   U16 __get_unaligned_val;
>   __builtin_memcpy(&__get_unaligned_val, (void *)(ptr),
>    sizeof(__get_unaligned_val));
>   __get_unaligned_val;
>   })
>
> so the analysis is correct that __get_unaligned_ctrl_type is
> unused, however, I've also put __always_unused on the variable.
> The purpose of that variable is for __unqual_scalar_typeof that
> passes the value to _Generic. I truly don't care about that
> variable but I care about it causing _Generic to get the correct
> type for __get_unaligned_val (that value can't be const as it is
> the destination of the memcpy). Why even declare
> __get_unaligned_ctrl_type? Well we want the result of __get_unaligned_t to
> match its type argument which needn't match the dereference of
> its pointer argument (*ptr) - I accept that in many cases it
> will. The value passed to _Generic is an expression and not a
> type, so declaring the variable and using the variable for
> _Generic allows this.
>
> My feeling is that my patch is correct and I'm not clear how to
> improve upon it. I believe it is a weakness in the analysis that
> the __always_unused isn't having an effect.
>
> Should adding new warnings for analysis on the code base be
> allowed for this patch? Well the upside to the patch is getting
> closer to not requiring -fno-strict-aliasing, or not introducing
> requiring that flag for things in the tools directory. I think
> the upside is good, I don't know how to mitigate the downside
> with poor analysis by certain tools.

Oh, the actual warning is "leaves the object uninitialized". It is
possible to silence this by changing:

  const U16 __get_unaligned_ctrl_type __always_unused;

to something like:

  const U16 __get_unaligned_ctrl_type __always_unused = 0;

You then get complained at that the code is using 0 instead of NULL
when instead of U16 the type of the __get_unaligned_t is a pointer.
Basically I've entered into an analysis tool wac-a-mole and I don't
have a combination to make them all happy.

Thanks,
Ian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-07-22 17:00         ` Ian Rogers
@ 2025-07-23 22:14           ` David Laight
  2025-08-18 16:03           ` Ian Rogers
  1 sibling, 0 replies; 11+ messages in thread
From: David Laight @ 2025-07-23 22:14 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Thomas Gleixner, kernel test robot, Eric Biggers, Yuzhuo Jing,
	Andy Lutomirski, Vincenzo Frascino, Arnaldo Carvalho de Melo,
	Al Viro, Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users, llvm, oe-kbuild-all

On Tue, 22 Jul 2025 10:00:51 -0700
Ian Rogers <irogers@google.com> wrote:

...
> Oh, the actual warning is "leaves the object uninitialized". It is
> possible to silence this by changing:
> 
>   const U16 __get_unaligned_ctrl_type __always_unused;
> 
> to something like:
> 
>   const U16 __get_unaligned_ctrl_type __always_unused = 0;
> 
> You then get complained at that the code is using 0 instead of NULL
> when instead of U16 the type of the __get_unaligned_t is a pointer.
> Basically I've entered into an analysis tool wac-a-mole and I don't
> have a combination to make them all happy.

Can you embed the variable inside a struct and then initialise with {} ?

Does this code actually work all the time?
There have always been 'problems' because gcc remembers the alignment
of pointers through (void *) casts.
So if your misaligned pointer has a type that should be aligned
them memcpy(&dest, (void *)misaligned_int_ptr, 4) will still do an
aligned read.

You also really need the compiler to optimise the memcpy into two
memory reads, some shifts, masks and ors, and a single write to a
register.
I'm not at all sure that is going to happen.
(Especially since I've never seen it optimised to only two reads
even when reading 'packed' variables.

	David

> 
> Thanks,
> Ian
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
  2025-07-22 17:00         ` Ian Rogers
  2025-07-23 22:14           ` David Laight
@ 2025-08-18 16:03           ` Ian Rogers
  1 sibling, 0 replies; 11+ messages in thread
From: Ian Rogers @ 2025-08-18 16:03 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: kernel test robot, Eric Biggers, Yuzhuo Jing, Andy Lutomirski,
	Vincenzo Frascino, Arnaldo Carvalho de Melo, Al Viro,
	Christophe Leroy, Jason A. Donenfeld, linux-kernel,
	linux-perf-users, llvm, oe-kbuild-all

On Tue, Jul 22, 2025 at 10:00 AM Ian Rogers <irogers@google.com> wrote:
>
> On Tue, Jul 22, 2025 at 9:44 AM Ian Rogers <irogers@google.com> wrote:
> >
> > On Tue, Jul 22, 2025 at 8:56 AM Thomas Gleixner <tglx@linutronix.de> wrote:
> > >
> > > Ian!
> > >
> > > On Sat, Jul 05 2025 at 08:05, kernel test robot wrote:
> > > > kernel test robot noticed the following build warnings:
> > > >
> > > > [auto build test WARNING on linus/master]
> > > > [also build test WARNING on tip/timers/vdso v6.16-rc4 next-20250704]
> > > > [cannot apply to acme/perf/core]
> > > > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > > > And when submitting patch, we suggest to use '--base' as documented in
> > > > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> > > >
> > > > url:    https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/vdso-Switch-get-put-unaligned-from-packed-struct-to-memcpy/20250626-135005
> > > > base:   linus/master
> > > > patch link:    https://lore.kernel.org/r/20250626054826.433453-2-irogers%40google.com
> > > > patch subject: [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy
> > > > config: s390-randconfig-002-20250705 (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/config)
> > > > compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 61529d9e36fa86782a2458e6bdeedf7f376ef4b5)
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250705/202507050736.b4hX0Xks-lkp@intel.com/reproduce)
> > > >
> > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > the same patch/commit), kindly add following tags
> > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202507050736.b4hX0Xks-lkp@intel.com/
> > > >
> > > > All warnings (new ones prefixed by >>):
> > > >
> > > >    In file included from arch/s390/boot/decompressor.c:48:
> > > >    In file included from arch/s390/include/uapi/../../../../lib/decompress_unlz4.c:10:
> > > >    In file included from arch/s390/include/uapi/../../../../lib/lz4/lz4_decompress.c:36:
> > > >>> arch/s390/include/uapi/../../../../lib/lz4/lz4defs.h:109:9: warning: default initialization of an object of type 'typeof (*((const U16 *)ptr))' (aka 'const unsigned short') leaves the object uninitialized [-Wdefault-const-init-var-unsafe]
> > > >      109 |         return get_unaligned((const U16 *)ptr);
> > > >          |                ^
> > >
> > > Any update on this one?

Hi Thomas,

I sent out a v4 patch set:
https://lore.kernel.org/lkml/20250722215754.672330-1-irogers@google.com/
which has no bot complaints but also no reviews. It side stepped some
of the challenges by always operating on pointer types. If people
could PTAL it would be appreciated as then we can pick up the changes
in tools and drop:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/commit/tools/perf/Makefile.config?h=perf-tools-next&id=55a18d2f3ff79c9082225f44e0abbaea6286bf99

Thanks,
Ian

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-08-18 16:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26  5:48 [PATCH v3 0/3] Switch get/put unaligned to use memcpy Ian Rogers
2025-06-26  5:48 ` [PATCH v3 1/3] vdso: Switch get/put unaligned from packed struct to memcpy Ian Rogers
2025-06-27  7:58   ` kernel test robot
2025-07-05  0:05   ` kernel test robot
2025-07-22 15:56     ` Thomas Gleixner
2025-07-22 16:44       ` Ian Rogers
2025-07-22 17:00         ` Ian Rogers
2025-07-23 22:14           ` David Laight
2025-08-18 16:03           ` Ian Rogers
2025-06-26  5:48 ` [PATCH v3 2/3] tools headers: Update the linux/unaligned.h copy with the kernel sources Ian Rogers
2025-06-26  5:48 ` [PATCH v3 3/3] tools headers: Remove unneeded ignoring of warnings in unaligned.h Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).