lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <583340a9-411d-406f-aee9-d3e2eb80ca43@app.fastmail.com>
Date: Fri, 21 Mar 2025 11:23:18 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Ignacio Encinas" <ignacio@...cinas.com>,
 "Paul Walmsley" <paul.walmsley@...ive.com>,
 "Palmer Dabbelt" <palmer@...belt.com>, "Alexandre Ghiti" <alex@...ti.fr>
Cc: "Eric Biggers" <ebiggers@...nel.org>, linux-riscv@...ts.infradead.org,
 linux-kernel@...r.kernel.org, linux-kernel-mentees@...ts.linux.dev,
 "Shuah Khan" <skhan@...uxfoundation.org>,
 "Zhihang Shao" <zhihang.shao.iscas@...il.com>,
 Björn Töpel <bjorn@...nel.org>,
 Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] include/uapi/linux/swab.h: move default implementation for
 swab macros into asm-generic

On Thu, Mar 20, 2025, at 23:36, Ignacio Encinas Rubio wrote:
> On 19/3/25 22:49, Arnd Bergmann wrote:
>> On Wed, Mar 19, 2025, at 22:37, Ignacio Encinas Rubio wrote:
>>> On 19/3/25 22:12, Arnd Bergmann wrote:
>> Right, I do remember when we had a discussion about this maybe
>> 15 years ago when gcc didn't have the builtins on all architectures
>> yet, but those versions are long gone, and we never cleaned it up.
>
> I just had a chance to look at this and it looks a bit more complex than
> I initially thought. ___constant_swab macros are used in more places
> than I expected, and {little,big}_endian.h define their own macros that
> are used elsewhere, ...
>
> It is not clear to me how to proceed here. I could:
>
>   1) Just remove ___constant_swab macros and replace them with
>   __builtin_swap everywhere
>
>   2) Go a step further and evaluate removing __constant_htonl and
>   relatives
>
> Let me know what you think is the best option :)

I think we can start enabling CONFIG_ARCH_USE_BUILTIN_BSWAP
on all architectures and removing the custom versions
from arch/*/include/uapi/asm/swab.h, which all seem to
predate the compiler builtins and likely produce worse code.

    Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ