mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: "Vineet Gupta" <vgupta@kernel.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"Dinh Nguyen" <dinguyen@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/5] ARC: uapi: Stop leaking CONFIG_ARC_HAS_SWAPE reference to userspace
Date: Fri, 02 Jan 2026 11:31:31 +0100	[thread overview]
Message-ID: <0ae2688a-5a22-405b-adaf-9b5ad712b245@app.fastmail.com> (raw)
In-Reply-To: <20260102103913-0420048c-d2f3-431b-8bbb-5962a1553aab@linutronix.de>

On Fri, Jan 2, 2026, at 10:40, Thomas Weißschuh wrote:
> On Fri, Jan 02, 2026 at 08:55:10AM +0100, Thomas Weißschuh wrote:
>> On Tue, Dec 30, 2025 at 10:23:08PM +0100, Arnd Bergmann wrote:
>> > On Tue, Dec 30, 2025, at 08:10, Thomas Weißschuh wrote:
>> > > UAPI headers are not supposed to leak references to kconfig symbols.
>> > > These won't be set when building userspace. Hide the kconfig reference
>> > > behind 'if defined(__KERNEL__)', so it will be stripped by
>> > > headers_install.sh. The result for userspace will be the same, but the
>> > > exception in headers_install.sh can also be removed.
>> > >
>> > > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>> > 
>> > Acked-by: Arnd Bergmann <arnd@arndb.de>
>> > 
>> > Same as for the nios2 version, I think the nicer solution would
>> > be to use the asm-generic header for uapi and move this one
>> > to arch/arc/include/asm/swab.h for kernel-internal use.
>> 
>> Ack. (...)
>
> This doesn't seem to be true. ARC does have a custom C implementation which
> according to its comment is supposed to be more efficient than the generic one.
> So I'd like to keep this as-is.

Right, though I see that since 767a697e7576 ("ARC: retire ARC750
support"), all supported CPUs do have the 'swape' instruction,
so I suppose we could just as well remove the CONFIG_ARC_HAS_SWAPE
symbol and just keep the inline asm version.

I also checked that for -mcpu=archs, the compiler uses swape
in __builtin_bswap32(), but it seems that there is no mcpu=arc770
option, and building for arc700 instead gets us the external
library call, which is likely worse than swape.

    Arnd

  reply	other threads:[~2026-01-02 10:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30  7:10 [PATCH 0/5] uapi: fix remaining kconfig leaks in UAPI headers Thomas Weißschuh
2025-12-30  7:10 ` [PATCH 1/5] ARC: uapi: Stop leaking CONFIG_ARC_HAS_SWAPE reference to userspace Thomas Weißschuh
2025-12-30 21:23   ` Arnd Bergmann
2026-01-02  7:55     ` Thomas Weißschuh
2026-01-02  9:40       ` Thomas Weißschuh
2026-01-02 10:31         ` Arnd Bergmann [this message]
2026-01-02 21:53     ` Vineet Gupta
2025-12-30  7:10 ` [PATCH 2/5] ARM: uapi: Stop leaking CONFIG_CPU_ENDIAN_BE8 " Thomas Weißschuh
2025-12-30 14:20   ` Arnd Bergmann
2025-12-30 14:33     ` Thomas Weißschuh
2025-12-30  7:10 ` [PATCH 3/5] nios2: uapi: Stop leaking CONFIG_NIOS2_CI_SWAB_{NO,SUPPORT} references " Thomas Weißschuh
2025-12-30 21:19   ` Arnd Bergmann
2025-12-30  7:10 ` [PATCH 4/5] x86/uapi: Stop leaking kconfig " Thomas Weißschuh
2025-12-30 21:08   ` Arnd Bergmann
2026-01-02  9:30     ` Thomas Weißschuh
2025-12-30  7:11 ` [PATCH 5/5] scripts: headers_install.sh: Remove config leak ignore machinery Thomas Weißschuh

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=0ae2688a-5a22-405b-adaf-9b5ad712b245@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dinguyen@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vgupta@kernel.org \
    --cc=x86@kernel.org \
    /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®