From: Nathan Chancellor <nathan@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: ndesaulniers@google.com, Arnd Bergmann <arnd@arndb.de>,
Tom Rix <trix@redhat.com>,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH] word-at-a-time: use the same return type for has_zero regardless of endianness
Date: Wed, 2 Aug 2023 09:15:53 -0700 [thread overview]
Message-ID: <20230802161553.GA2108867@dev-arch.thelio-3990X> (raw)
In-Reply-To: <CAHk-=wgkC80Ey0Wyi3zHYexUmteeDL3hvZrp=EpMrDccRGmMwA@mail.gmail.com>
On Tue, Aug 01, 2023 at 06:07:08PM -0700, Linus Torvalds wrote:
> I think the patch is fine, but I guess I'd like to know that people
> who are affected actually don't see any code generation changes (or
> possibly see improvements from not turning it into a bool until later)
We see this warning with ARCH=arm64 defconfig + CONFIG_CPU_BIG_ENDIAN=y.
With both clang 18.0.0 (tip of tree) and GCC 13.1.0, I don't see any
actual code generation changes in fs/namei.o with this configuration.
I'd be pretty surprised if any of the other uses of has_zero() show any
changes, I at least checked lib/string.o with that configuration and
s390 and did not see anything.
As far as I can tell, arm and arm64 with CONFIG_CPU_BIG_ENDIAN=y are the
only configurations that can hit the particular bit of code with the
generic big endian has_zero() implementation because the version of
hash_name() that uses has_zero() in this manner is only used when
CONFIG_DCACHE_WORD_ACCESS is set, which only arm, arm64, powerpc (little
endian), and x86 select.
arch/arm/Kconfig:49: select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
arch/arm64/Kconfig:121: select DCACHE_WORD_ACCESS
arch/powerpc/Kconfig:183: select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN
arch/x86/Kconfig:140: select DCACHE_WORD_ACCESS if !KMSAN
arch/x86/um/Kconfig:12: select DCACHE_WORD_ACCESS
So seems like a pretty low risk patch to me but I could be missing
something.
Cheers,
Nathan
next prev parent reply other threads:[~2023-08-02 16:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 22:22 [PATCH] word-at-a-time: use the same return type for has_zero regardless of endianness ndesaulniers
2023-08-01 22:45 ` Nick Desaulniers
2023-08-02 1:07 ` Linus Torvalds
2023-08-02 5:59 ` Arnd Bergmann
2023-08-02 7:50 ` Heiko Carstens
2023-08-02 16:15 ` Nathan Chancellor [this message]
2023-08-02 17:37 ` Linus Torvalds
2023-08-02 18:17 ` Arnd Bergmann
2023-08-04 13:04 ` Will Deacon
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=20230802161553.GA2108867@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=ndesaulniers@google.com \
--cc=torvalds@linux-foundation.org \
--cc=trix@redhat.com \
/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