mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fang Xieyan <fangxy@xiaopeng.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] asm-generic: bitsperlong: Remove the disabled BITS_PER_LONG check
Date: Tue, 24 Nov 2026 01:08:33 +0800	[thread overview]
Message-ID: <20261123170833.30158-1-fangxy@xiaopeng.com> (raw)
In-Reply-To: <20261123104512.58227-1-fangxy@xiaopeng.com>

Hi Arnd, Thomas,

A follow-up with the build evidence I promised.

I temporarily re-enabled the check and replayed the exact saved
compile commands for each x86-64 build scenario:

  - The check fails for 23 objects in arch/x86/boot and 12 objects
    in arch/x86/realmode. They are compiled with -m16 (which uses
    the 32-bit C data model) but retain the actual 64-bit kernel
    configuration, so BITS_PER_LONG is 64 while __BITS_PER_LONG is
    32. Both paths reach the header via <linux/types.h>: boot.h
    includes it directly, while the realmode path reaches it
    through <linux/linkage.h> -> <asm/ibt.h>.
  - boot/compressed (-m64) and vdso64 pass. vdso32 also passes
    because its build force-includes fake_32bit_build.h, which
    undefines CONFIG_64BIT and defines CONFIG_X86_32.

One correction to my earlier reply: boot fails as well, not just
realmode. I missed it because bzImage is only built after vmlinux,
and the realmode failure stopped the build before boot was reached.

So there seem to be two separate issues:

  1. boot/realmode: 32-bit C code compiled with -m16 while
     retaining the 64-bit kernel configuration.
  2. vDSO header isolation: the sanctioned include/vdso headers
     still include <linux/types.h>, and the <linux/types.h>
     dependency chain eventually reaches the kernel-internal
     include/asm-generic/bitsperlong.h. I verified this with
     compiler -H traces.

Would you treat these as separate issues? In particular, should
the BITS_PER_LONG check be scoped to native kernel compilation,
with boot/realmode handled separately?

For the vDSO, would you prefer VDSO-specific basic type
definitions, or a sanitized subset of UAPI types that can be used
without pulling in kernel-internal headers?

Thomas, is there any ongoing work in this area?

Thanks,
Fang Xieyan

      reply	other threads:[~2026-11-23 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 14:04 Fang Xieyan
2026-11-23  8:08 ` Arnd Bergmann
2026-11-23 10:45   ` Fang Xieyan
2026-11-23 17:08     ` Fang Xieyan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123170833.30158-1-fangxy@xiaopeng.com \
    --to=fangxy@xiaopeng.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®