* [PATCH] asm-generic: bitsperlong: Remove the disabled BITS_PER_LONG check
@ 2026-11-21 14:04 Fang Xieyan
2026-11-23 8:08 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Fang Xieyan @ 2026-11-21 14:04 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-arch, linux-kernel, Thomas Weißschuh
A FIXME in this header asks to fix x86-64 and reenable the check
between BITS_PER_LONG and __BITS_PER_LONG. However, this check
cannot be enabled because the two values can legitimately differ
when building the compat vDSO.
BITS_PER_LONG is derived from CONFIG_64BIT and reflects the
kernel's configured word size, while __BITS_PER_LONG reflects
the compiler target ABI.
The existing sanity checks validate __BITS_PER_LONG against the
actual C type 'long'. For regular kernel builds, this also detects
mismatches between BITS_PER_LONG and __BITS_PER_LONG, since
BITS_PER_LONG matches the kernel's native word size.
Remove the dead check and the misleading FIXME.
Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
The preprocessed output of this header is unchanged in 64-bit, 32-bit
and compat vDSO (-m32 with CONFIG_64BIT) builds. Build-tested on x86_64
defconfig (IA32_EMULATION=y), including the vdso32 build.
include/asm-generic/bitsperlong.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/include/asm-generic/bitsperlong.h b/include/asm-generic/bitsperlong.h
index 90e8aeebfd2f..5183b50d3080 100644
--- a/include/asm-generic/bitsperlong.h
+++ b/include/asm-generic/bitsperlong.h
@@ -11,14 +11,6 @@
#define BITS_PER_LONG 32
#endif /* CONFIG_64BIT */
-/*
- * FIXME: The check currently breaks x86-64 build, so it's
- * temporarily disabled. Please fix x86-64 and reenable
- */
-#if 0 && BITS_PER_LONG != __BITS_PER_LONG
-#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
--
2.50.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] asm-generic: bitsperlong: Remove the disabled BITS_PER_LONG check
2026-11-21 14:04 [PATCH] asm-generic: bitsperlong: Remove the disabled BITS_PER_LONG check Fang Xieyan
@ 2026-11-23 8:08 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2026-11-23 8:08 UTC (permalink / raw)
To: Fang Xieyan; +Cc: Linux-Arch, linux-kernel, Thomas Weißschuh
On Sat, Nov 21, 2026, at 15:04, Fang Xieyan wrote:
> A FIXME in this header asks to fix x86-64 and reenable the check
> between BITS_PER_LONG and __BITS_PER_LONG. However, this check
> cannot be enabled because the two values can legitimately differ
> when building the compat vDSO.
I think the correct fix would be to stop the x86 vdso from including
this header. The general rule is that any VDSO code should only
include headers from include/vdso/, but not include/linux or include/asm.
Arnd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-23 8:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-21 14:04 [PATCH] asm-generic: bitsperlong: Remove the disabled BITS_PER_LONG check Fang Xieyan
2026-11-23 8:08 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®