[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <0ae2688a-5a22-405b-adaf-9b5ad712b245@app.fastmail.com>
Date: Fri, 02 Jan 2026 11:31:31 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Cc: "Vineet Gupta" <vgupta@...nel.org>,
"Russell King" <linux@...linux.org.uk>, "Dinh Nguyen" <dinguyen@...nel.org>,
"Thomas Gleixner" <tglx@...utronix.de>, "Ingo Molnar" <mingo@...hat.com>,
"Borislav Petkov" <bp@...en8.de>,
"Dave Hansen" <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, linux-snps-arc@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/5] ARC: uapi: Stop leaking CONFIG_ARC_HAS_SWAPE reference to
userspace
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@...utronix.de>
>> >
>> > Acked-by: Arnd Bergmann <arnd@...db.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
Powered by blists - more mailing lists