public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO
@ 2026-03-02  7:58 Thomas Weißschuh
  2026-03-02  7:58 ` [PATCH v2 1/5] x86/vdso: " Thomas Weißschuh
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-02  7:58 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Thomas Weißschuh, Sun Jian, kernel test robot,
	Dan Carpenter

When building the compat vDSO the CHECKFLAGS from the 64-bit kernel
are used. These are combined with the 32-bit CFLAGS. This confuses
sparse, producing false-positive warnings or potentially missing
real issues.

Manually override the CHECKFLAGS for the compat vDSO with the correct
32-bit configuration.

Not all architectures are supported, as many do not use sparse for their
(compat) vDSO. These can be enabled later.

Also add some checks to bitsperlong.h to detect such issues earlier.

Based on tip/timers/vdso.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Changes in v2:
- Simplify __BITS_PER_LONG consistency checks
- Fix an inconsistency in the powerpc audit code
- Move check to kernel headers instead of UAPI ones
- Use KBUILD_CPPFLAGS = -m64 on s390 instead,
  the previous include trimming turned out to require changes to many more files
- Rebase on v7.0-rc1
- Link to v1: https://lore.kernel.org/r/20260116-vdso-compat-checkflags-v1-0-4a83b4fbb0d3@linutronix.de

---
Thomas Weißschuh (5):
      x86/vdso: Use 32-bit CHECKFLAGS for compat vDSO
      sparc64: vdso: Use 32-bit CHECKFLAGS for compat vDSO
      s390: Add -m64 to KBUILD_CPPFLAGS
      powerpc/audit: directly include unistd_32.h from compat_audit.c
      asm-generic/bitsperlong.h: Add sanity checks for __BITS_PER_LONG

 arch/powerpc/kernel/compat_audit.c  | 3 +--
 arch/s390/Makefile                  | 3 +--
 arch/sparc/vdso/Makefile            | 3 +++
 arch/x86/entry/vdso/vdso32/Makefile | 4 ++++
 include/asm-generic/bitsperlong.h   | 9 +++++++++
 5 files changed, 18 insertions(+), 4 deletions(-)
---
base-commit: 740f1913cfa0d48222760eaa438c509ca9fc3710
change-id: 20251107-vdso-compat-checkflags-5db75b3b4bac

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>


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

* [PATCH v2 1/5] x86/vdso: Use 32-bit CHECKFLAGS for compat vDSO
  2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
@ 2026-03-02  7:58 ` Thomas Weißschuh
  2026-03-02  7:58 ` [PATCH v2 2/5] sparc64: vdso: " Thomas Weißschuh
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-02  7:58 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Thomas Weißschuh, Sun Jian, kernel test robot,
	Dan Carpenter

When building the compat vDSO the CHECKFLAGS from the 64-bit kernel
are used. These are combined with the 32-bit CFLAGS. This confuses
sparse, producing false-positive warnings or potentially missing
real issues.

Manually override the CHECKFLAGS for the compat vDSO with the correct
32-bit configuration.

Reported-by: Sun Jian <sun.jian.kdev@gmail.com>
Closes: https://lore.kernel.org/lkml/20260114084529.1676356-1-sun.jian.kdev@gmail.com/
Closes: https://lore.kernel.org/lkml/20260117215542.342638347@kernel.org/
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202602111941.PIhubgrb-lkp@intel.com/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/entry/vdso/vdso32/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/entry/vdso/vdso32/Makefile b/arch/x86/entry/vdso/vdso32/Makefile
index add6afb484ba..ded4fc6a48cd 100644
--- a/arch/x86/entry/vdso/vdso32/Makefile
+++ b/arch/x86/entry/vdso/vdso32/Makefile
@@ -15,6 +15,10 @@ flags-y			:= -DBUILD_VDSO32 -m32 -mregparm=0
 flags-$(CONFIG_X86_64)	+= -include $(src)/fake_32bit_build.h
 flags-remove-y          := -m64
 
+# Checker flags
+CHECKFLAGS := $(subst -m64,-m32,$(CHECKFLAGS))
+CHECKFLAGS := $(subst -D__x86_64__,-D__i386__,$(CHECKFLAGS))
+
 # The location of this include matters!
 include $(src)/../common/Makefile.include
 

-- 
2.53.0


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

* [PATCH v2 2/5] sparc64: vdso: Use 32-bit CHECKFLAGS for compat vDSO
  2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
  2026-03-02  7:58 ` [PATCH v2 1/5] x86/vdso: " Thomas Weißschuh
@ 2026-03-02  7:58 ` Thomas Weißschuh
  2026-03-02  7:58 ` [PATCH v2 3/5] s390: Add -m64 to KBUILD_CPPFLAGS Thomas Weißschuh
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-02  7:58 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Thomas Weißschuh, kernel test robot

When building the compat vDSO the CHECKFLAGS from the 64-bit kernel
are used. These are combined with the 32-bit CFLAGS. This confuses
sparse, producing false-positive warnings or potentially missing
real issues.

Manually override the CHECKFLAGS for the compat vDSO with the correct
32-bit configuration.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/lkml/202511030021.9v1mIgts-lkp@intel.com/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
The actual false-positive is only reported when SPARC is converted over
to the generic vDSO library. However the issue is already present.
To avoid dependencies between different patch queues, I have this patch
in this one.
---
 arch/sparc/vdso/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile
index 13f1d7be00f1..7d6e3097ebfc 100644
--- a/arch/sparc/vdso/Makefile
+++ b/arch/sparc/vdso/Makefile
@@ -90,6 +90,9 @@ KBUILD_CFLAGS_32 += -DDISABLE_BRANCH_PROFILING
 KBUILD_CFLAGS_32 += -mv8plus
 $(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
 
+CHECKFLAGS_32 := $(filter-out -m64 -D__sparc_v9__ -D__arch64__, $(CHECKFLAGS)) -m32
+$(obj)/vdso32.so.dbg: CHECKFLAGS = $(CHECKFLAGS_32)
+
 $(obj)/vdso32.so.dbg: FORCE \
 			$(obj)/vdso32/vdso32.lds \
 			$(obj)/vdso32/vclock_gettime.o \

-- 
2.53.0


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

* [PATCH v2 3/5] s390: Add -m64 to KBUILD_CPPFLAGS
  2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
  2026-03-02  7:58 ` [PATCH v2 1/5] x86/vdso: " Thomas Weißschuh
  2026-03-02  7:58 ` [PATCH v2 2/5] sparc64: vdso: " Thomas Weißschuh
@ 2026-03-02  7:58 ` Thomas Weißschuh
  2026-03-02  8:42   ` Arnd Bergmann
  2026-03-02  7:58 ` [PATCH v2 4/5] powerpc/audit: directly include unistd_32.h from compat_audit.c Thomas Weißschuh
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-02  7:58 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Thomas Weißschuh

Some non-code files, like linkescripts, are preprocessed with the C
preprocessor and make use of regular kernel headers.
As -m64 is not passed to those preprocessor invocations this leads
to an inconsistency between __BITS_PER_LONG and the C type 'long'.
An upcoming consistency check will be tripped by this.

Make sure -m64 is also defined for those preprocessing steps.

As KBUILD_CPPFLAGS is inherited by both KBUILD_AFLAGS and KBUILD_CFLAGS,
drop -m64 from these variables.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 arch/s390/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index d78ad6885ca2..02bc948a4a56 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -12,8 +12,7 @@ LD_BFD		:= elf64-s390
 KBUILD_LDFLAGS	:= -m elf64_s390
 KBUILD_AFLAGS_MODULE += -fPIC
 KBUILD_CFLAGS_MODULE += -fPIC
-KBUILD_AFLAGS	+= -m64
-KBUILD_CFLAGS	+= -m64
+KBUILD_CPPFLAGS	+= -m64
 KBUILD_CFLAGS	+= -fPIC
 LDFLAGS_vmlinux	:= $(call ld-option,-no-pie)
 extra_tools	:= relocs

-- 
2.53.0


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

* [PATCH v2 4/5] powerpc/audit: directly include unistd_32.h from compat_audit.c
  2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
                   ` (2 preceding siblings ...)
  2026-03-02  7:58 ` [PATCH v2 3/5] s390: Add -m64 to KBUILD_CPPFLAGS Thomas Weißschuh
@ 2026-03-02  7:58 ` Thomas Weißschuh
  2026-03-02  8:41   ` Arnd Bergmann
  2026-03-02  7:58 ` [PATCH v2 5/5] asm-generic/bitsperlong.h: Add sanity checks for __BITS_PER_LONG Thomas Weißschuh
  2026-03-06 10:43 ` [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Christophe Leroy (CS GROUP)
  5 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-02  7:58 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Thomas Weißschuh

This source file undefines '__powerpc64__' to get the 32-bit system call
numbers from asm/unistd.h. However this symbol is also evaluated by
other headers, among them is asm/bitsperlong.h. The undefinition leads
to an inconsistency between __BITS_PER_LONG and the C type 'long'.
An upcoming consistency check will be tripped by this.

Directly include asm/unistd_32.h to get access to the 32-bit system call
numbers instead.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 arch/powerpc/kernel/compat_audit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/compat_audit.c b/arch/powerpc/kernel/compat_audit.c
index 57b38c592b9f..b4d81a57b2d9 100644
--- a/arch/powerpc/kernel/compat_audit.c
+++ b/arch/powerpc/kernel/compat_audit.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
-#undef __powerpc64__
 #include <linux/audit_arch.h>
-#include <asm/unistd.h>
+#include <asm/unistd_32.h>
 
 #include "audit_32.h"
 

-- 
2.53.0


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

* [PATCH v2 5/5] asm-generic/bitsperlong.h: Add sanity checks for __BITS_PER_LONG
  2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
                   ` (3 preceding siblings ...)
  2026-03-02  7:58 ` [PATCH v2 4/5] powerpc/audit: directly include unistd_32.h from compat_audit.c Thomas Weißschuh
@ 2026-03-02  7:58 ` Thomas Weißschuh
  2026-03-06 10:43 ` [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Christophe Leroy (CS GROUP)
  5 siblings, 0 replies; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-02  7:58 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Thomas Weißschuh

The value of __BITS_PER_LONG from architecture-specific logic should
always match the generic one if that is available. It should also match
the actual C type 'long'.

Mismatches can happen for example when building the compat vDSO. Either
during the compilation, see commit 9a6d3ff10f7f ("arm64: uapi: Provide
correct __BITS_PER_LONG for the compat vDSO"), or when running sparse
when mismatched CHECKFLAGS are inherited from the kernel build.

Add some consistency checks which detect such issues early and clearly.

The kernel-internal BITS_PER_LONG is not checked as it is derived from
CONFIG_64BIT and therefore breaks for the compat vDSO. See the similar,
deactivated check above.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 include/asm-generic/bitsperlong.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/asm-generic/bitsperlong.h b/include/asm-generic/bitsperlong.h
index 1023e2a4bd37..90e8aeebfd2f 100644
--- a/include/asm-generic/bitsperlong.h
+++ b/include/asm-generic/bitsperlong.h
@@ -19,6 +19,15 @@
 #error Inconsistent word size. Check asm/bitsperlong.h
 #endif
 
+#if __CHAR_BIT__ * __SIZEOF_LONG__ != __BITS_PER_LONG
+#error Inconsistent word size. Check asm/bitsperlong.h
+#endif
+
+#ifndef __ASSEMBLER__
+_Static_assert(sizeof(long) * 8 == __BITS_PER_LONG,
+	       "Inconsistent word size. Check asm/bitsperlong.h");
+#endif
+
 #ifndef BITS_PER_LONG_LONG
 #define BITS_PER_LONG_LONG 64
 #endif

-- 
2.53.0


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

* Re: [PATCH v2 4/5] powerpc/audit: directly include unistd_32.h from compat_audit.c
  2026-03-02  7:58 ` [PATCH v2 4/5] powerpc/audit: directly include unistd_32.h from compat_audit.c Thomas Weißschuh
@ 2026-03-02  8:41   ` Arnd Bergmann
  0 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2026-03-02  8:41 UTC (permalink / raw)
  To: Thomas Weißschuh, David S . Miller, Andreas Larsson,
	Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy
  Cc: sparclinux, linux-kernel, Linux-Arch, linux-s390, David Laight,
	linuxppc-dev

On Mon, Mar 2, 2026, at 08:58, Thomas Weißschuh wrote:
> This source file undefines '__powerpc64__' to get the 32-bit system call
> numbers from asm/unistd.h. However this symbol is also evaluated by
> other headers, among them is asm/bitsperlong.h. The undefinition leads
> to an inconsistency between __BITS_PER_LONG and the C type 'long'.
> An upcoming consistency check will be tripped by this.
>
> Directly include asm/unistd_32.h to get access to the 32-bit system call
> numbers instead.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH v2 3/5] s390: Add -m64 to KBUILD_CPPFLAGS
  2026-03-02  7:58 ` [PATCH v2 3/5] s390: Add -m64 to KBUILD_CPPFLAGS Thomas Weißschuh
@ 2026-03-02  8:42   ` Arnd Bergmann
  0 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2026-03-02  8:42 UTC (permalink / raw)
  To: Thomas Weißschuh, David S . Miller, Andreas Larsson,
	Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy
  Cc: sparclinux, linux-kernel, Linux-Arch, linux-s390, David Laight,
	linuxppc-dev

On Mon, Mar 2, 2026, at 08:58, Thomas Weißschuh wrote:
> Some non-code files, like linkescripts, are preprocessed with the C
> preprocessor and make use of regular kernel headers.
> As -m64 is not passed to those preprocessor invocations this leads
> to an inconsistency between __BITS_PER_LONG and the C type 'long'.
> An upcoming consistency check will be tripped by this.
>
> Make sure -m64 is also defined for those preprocessing steps.
>
> As KBUILD_CPPFLAGS is inherited by both KBUILD_AFLAGS and KBUILD_CFLAGS,
> drop -m64 from these variables.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO
  2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
                   ` (4 preceding siblings ...)
  2026-03-02  7:58 ` [PATCH v2 5/5] asm-generic/bitsperlong.h: Add sanity checks for __BITS_PER_LONG Thomas Weißschuh
@ 2026-03-06 10:43 ` Christophe Leroy (CS GROUP)
  2026-03-06 13:08   ` Thomas Weißschuh
  5 siblings, 1 reply; 11+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-03-06 10:43 UTC (permalink / raw)
  To: Thomas Weißschuh, David S. Miller, Andreas Larsson,
	Andy Lutomirski, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Arnd Bergmann, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin
  Cc: sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Sun Jian, kernel test robot, Dan Carpenter



Le 02/03/2026 à 08:58, Thomas Weißschuh a écrit :
> When building the compat vDSO the CHECKFLAGS from the 64-bit kernel
> are used. These are combined with the 32-bit CFLAGS. This confuses
> sparse, producing false-positive warnings or potentially missing
> real issues.
> 
> Manually override the CHECKFLAGS for the compat vDSO with the correct
> 32-bit configuration.
> 
> Not all architectures are supported, as many do not use sparse for their
> (compat) vDSO. These can be enabled later.
> 
> Also add some checks to bitsperlong.h to detect such issues earlier.
> 
> Based on tip/timers/vdso.
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> Changes in v2:
> - Simplify __BITS_PER_LONG consistency checks
> - Fix an inconsistency in the powerpc audit code

The powerpc audit code should be replaced by generic 
AUDIT_ARCH_COMPAT_GENERIC, as there is no difference between them 
apparently.

A tentative was made in the past but was declined by audit maintainers 
because we were not able to test it allthought the failure was the same 
before and after the patch, see 
https://github.com/linuxppc/issues/issues/412

Christophe


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

* Re: [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO
  2026-03-06 10:43 ` [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Christophe Leroy (CS GROUP)
@ 2026-03-06 13:08   ` Thomas Weißschuh
  2026-03-06 13:26     ` Christophe Leroy (CS GROUP)
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Weißschuh @ 2026-03-06 13:08 UTC (permalink / raw)
  To: Christophe Leroy (CS GROUP)
  Cc: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Sun Jian, kernel test robot, Dan Carpenter

On Fri, Mar 06, 2026 at 11:43:24AM +0100, Christophe Leroy (CS GROUP) wrote:
> 
> 
> Le 02/03/2026 à 08:58, Thomas Weißschuh a écrit :
> > When building the compat vDSO the CHECKFLAGS from the 64-bit kernel
> > are used. These are combined with the 32-bit CFLAGS. This confuses
> > sparse, producing false-positive warnings or potentially missing
> > real issues.
> > 
> > Manually override the CHECKFLAGS for the compat vDSO with the correct
> > 32-bit configuration.
> > 
> > Not all architectures are supported, as many do not use sparse for their
> > (compat) vDSO. These can be enabled later.
> > 
> > Also add some checks to bitsperlong.h to detect such issues earlier.
> > 
> > Based on tip/timers/vdso.
> > 
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > ---
> > Changes in v2:
> > - Simplify __BITS_PER_LONG consistency checks
> > - Fix an inconsistency in the powerpc audit code
> 
> The powerpc audit code should be replaced by generic
> AUDIT_ARCH_COMPAT_GENERIC, as there is no difference between them
> apparently.

Agreed.

> A tentative was made in the past but was declined by audit maintainers
> because we were not able to test it allthought the failure was the same
> before and after the patch, see
> https://github.com/linuxppc/issues/issues/412

On v7.0-rc1 the test failure of filter_exclude/test is gone.
It also keeps working when applying your patch. Some other tests are
broken, but it looks that is due to missing dependencies on Debian.
So maybe it is time to resubmit your patch.

In any case, I don't really want to entangle my series with the switch
to AUDIT_ARCH_COMPAT_GENERIC. My proposed cleanup does not make the code
worse and if both patches are applied the conflict will be trivial to
resolve.


Thomas

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

* Re: [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO
  2026-03-06 13:08   ` Thomas Weißschuh
@ 2026-03-06 13:26     ` Christophe Leroy (CS GROUP)
  0 siblings, 0 replies; 11+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-03-06 13:26 UTC (permalink / raw)
  To: Thomas Weißschuh
  Cc: David S. Miller, Andreas Larsson, Andy Lutomirski,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, Arnd Bergmann, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	sparclinux, linux-kernel, linux-arch, linux-s390, David Laight,
	linuxppc-dev, Sun Jian, kernel test robot, Dan Carpenter



Le 06/03/2026 à 14:08, Thomas Weißschuh a écrit :
> On Fri, Mar 06, 2026 at 11:43:24AM +0100, Christophe Leroy (CS GROUP) wrote:
>>
>>
>> Le 02/03/2026 à 08:58, Thomas Weißschuh a écrit :
>>> When building the compat vDSO the CHECKFLAGS from the 64-bit kernel
>>> are used. These are combined with the 32-bit CFLAGS. This confuses
>>> sparse, producing false-positive warnings or potentially missing
>>> real issues.
>>>
>>> Manually override the CHECKFLAGS for the compat vDSO with the correct
>>> 32-bit configuration.
>>>
>>> Not all architectures are supported, as many do not use sparse for their
>>> (compat) vDSO. These can be enabled later.
>>>
>>> Also add some checks to bitsperlong.h to detect such issues earlier.
>>>
>>> Based on tip/timers/vdso.
>>>
>>> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>>> ---
>>> Changes in v2:
>>> - Simplify __BITS_PER_LONG consistency checks
>>> - Fix an inconsistency in the powerpc audit code
>>
>> The powerpc audit code should be replaced by generic
>> AUDIT_ARCH_COMPAT_GENERIC, as there is no difference between them
>> apparently.
> 
> Agreed.
> 
>> A tentative was made in the past but was declined by audit maintainers
>> because we were not able to test it allthought the failure was the same
>> before and after the patch, see
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flinuxppc%2Fissues%2Fissues%2F412&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cca6c85b42bd44c6a80c608de7b81819d%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639083993321723266%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=VxTy22klpH9H8Altgcthr%2F%2ByUIL6q%2FbBkDV7FQS%2BljI%3D&reserved=0
> 
> On v7.0-rc1 the test failure of filter_exclude/test is gone.
> It also keeps working when applying your patch. Some other tests are
> broken, but it looks that is due to missing dependencies on Debian.
> So maybe it is time to resubmit your patch.
> 
> In any case, I don't really want to entangle my series with the switch
> to AUDIT_ARCH_COMPAT_GENERIC. My proposed cleanup does not make the code
> worse and if both patches are applied the conflict will be trivial to
> resolve.

I didn't mean to interfere with your patch, it is just that your patch 
reminded me that tentative.

Thanks for testing, I will consider re-posting my patch based on your test.

Christophe

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

end of thread, other threads:[~2026-03-06 13:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02  7:58 [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Thomas Weißschuh
2026-03-02  7:58 ` [PATCH v2 1/5] x86/vdso: " Thomas Weißschuh
2026-03-02  7:58 ` [PATCH v2 2/5] sparc64: vdso: " Thomas Weißschuh
2026-03-02  7:58 ` [PATCH v2 3/5] s390: Add -m64 to KBUILD_CPPFLAGS Thomas Weißschuh
2026-03-02  8:42   ` Arnd Bergmann
2026-03-02  7:58 ` [PATCH v2 4/5] powerpc/audit: directly include unistd_32.h from compat_audit.c Thomas Weißschuh
2026-03-02  8:41   ` Arnd Bergmann
2026-03-02  7:58 ` [PATCH v2 5/5] asm-generic/bitsperlong.h: Add sanity checks for __BITS_PER_LONG Thomas Weißschuh
2026-03-06 10:43 ` [PATCH v2 0/5] vDSO: Use 32-bit CHECKFLAGS for compat vDSO Christophe Leroy (CS GROUP)
2026-03-06 13:08   ` Thomas Weißschuh
2026-03-06 13:26     ` Christophe Leroy (CS GROUP)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox