From: Borislav Petkov <bp@alien8.de>
To: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: Nikolay Borisov <nik.borisov@suse.com>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
Yazen.Ghannam@amd.com
Subject: Re: [PATCH v2] RAS/AMD/ATL: Remove bitwise_xor_bits
Date: Mon, 24 Nov 2025 13:52:49 +0100 [thread overview]
Message-ID: <20251124125249.GDaSRVIapy2dmis28p@fat_crate.local> (raw)
In-Reply-To: <aSRJdskInHGmbjIo@google.com>
On Mon, Nov 24, 2025 at 08:03:02PM +0800, Kuan-Wei Chiu wrote:
> On Mon, Nov 24, 2025 at 12:05:26PM +0100, Borislav Petkov wrote:
> > On Mon, Nov 24, 2025 at 04:57:51PM +0800, Kuan-Wei Chiu wrote:
> > > > Both LLVM/GCC support a __builtin_parity function which is functionally
> > > > equivalent to the custom bitwise_xor_bits() one. Let's simplify the code by
> > > > relying on the built-in. No functional changes.
> > >
> > > IIRC in some cases,
> >
> > Which are those cases?
> >
> > Do you have a trigger scenario?
> >
> I did a quick search, and I believe it was this kernel test robot
> report [1] that reminded me of this compiler behavior.
>
> [1]: https://lore.kernel.org/oe-kbuild-all/202501312159.l6jNRaYy-lkp@intel.com/
Interesting, thanks for the pointer.
@Nik, just use hweight16() but pls do check what asm the compiler generates
before and after so that at least there's some palpable improvement or gcc is
smart enough to replace the unrolled XORing with something slick.
Also put in the commit message why we're not using the builtin parity thing
and quote the link above.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2025-11-24 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 8:40 [PATCH v2] RAS/AMD/ATL: Remove bitwise_xor_bits Nikolay Borisov
2025-11-24 8:57 ` Kuan-Wei Chiu
2025-11-24 11:05 ` Borislav Petkov
2025-11-24 12:03 ` Kuan-Wei Chiu
2025-11-24 12:52 ` Borislav Petkov [this message]
2025-11-24 13:24 ` Nikolay Borisov
2025-11-24 13:34 ` Borislav Petkov
2025-11-25 9:35 ` david laight
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=20251124125249.GDaSRVIapy2dmis28p@fat_crate.local \
--to=bp@alien8.de \
--cc=Yazen.Ghannam@amd.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nik.borisov@suse.com \
--cc=visitorckw@gmail.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