From: Eric Biggers <ebiggers@kernel.org>
To: Ard Biesheuvel <ardb+git@google.com>
Cc: linux-arm-kernel@lists.infradead.org,
Ard Biesheuvel <ardb@kernel.org>, Christoph Hellwig <hch@lst.de>,
Demian Shulhan <demyansh@gmail.com>
Subject: Re: [PATCH 2/2] raid6: arm64: use the EOR3 instruction where available
Date: Thu, 19 Nov 2026 14:35:13 -0800 [thread overview]
Message-ID: <20261119223513.GB1894@quark> (raw)
In-Reply-To: <20261118183335.1944213-6-ardb+git@google.com>
On Wed, Nov 18, 2026 at 07:33:38PM +0100, Ard Biesheuvel wrote:
> Build the EOR3 versions from the same neon.uc source, with
> RAID6_NEON_EOR3 defined and the SHA3 extension enabled, and use them
> instead of the plain NEON versions on CPUs that implement SHA3. Use
> -march=armv8.2-a+sha3 for this: SHA3 is an optional extension of
> ARMv8.2, so any CPU that implements it implements ARMv8.2 as well. This
> is also what older toolchains (e.g., GCC 8.5 with binutils 2.36) need to
> accept EOR3.
gcc 8.1 supports the sha3 feature itself, but the veor3q_u8() intrinsic
wasn't added until gcc 9.1 and gcc 8.5. Since the minimum gcc version
to build the kernel is 8.1, we probably need a gcc version check.
> - struct raid6_calls const raid6_neonx ## _n = { \
> - .gen_syndrome = raid6_neon ## _n ## _gen_syndrome, \
> - .xor_syndrome = raid6_neon ## _n ## _xor_syndrome, \
> - .name = "neonx" #_n, \
> + struct raid6_calls const raid6_ ## _name = { \
> + .gen_syndrome = _pfx ## _n ## _gen_syndrome, \
> + .xor_syndrome = _pfx ## _n ## _xor_syndrome, \
> + .name = #_name, \
> }
Nit: 'const' should go before 'struct'
> @@ -129,7 +145,7 @@ static inline void STEP4(unative_t *wp, unative_t *wq, const uint8_t *s3,
> unative_t d1 = vld1q_u8(s1);
> unative_t d0 = vld1q_u8(s0);
>
> - *wp ^= d3 ^ d2 ^ d1 ^ d0;
> + *wp = XOR3(XOR3(*wp, d3, d2), d1, d0);
> *wq = HORNER4(*wq, d3, d2, d1, d0, x1d);
> }
The following might be better, since it cuts down the length of the
loop-carried dependency chain on *wp.
*wp = XOR3(*wp, XOR3(d3, d2, d1), d0);
> diff --git a/lib/raid/raid6/arm64/pq_arch.h b/lib/raid/raid6/arm64/pq_arch.h
> index 27ff564d7594..4e397aa36480 100644
> --- a/lib/raid/raid6/arm64/pq_arch.h
> +++ b/lib/raid/raid6/arm64/pq_arch.h
> @@ -1 +1,33 @@
> -#include "arm/pq_arch.h"
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +
> +#include <linux/cpufeature.h>
> +#include <asm/neon.h>
> +
> +extern const struct raid6_calls raid6_neonx1;
> +extern const struct raid6_calls raid6_neonx2;
> +extern const struct raid6_calls raid6_neonx4;
> +extern const struct raid6_calls raid6_neonx8;
> +extern const struct raid6_calls raid6_eor3x1;
> +extern const struct raid6_calls raid6_eor3x2;
> +extern const struct raid6_calls raid6_eor3x4;
> +extern const struct raid6_calls raid6_eor3x8;
> +extern const struct raid6_recov_calls raid6_recov_neon;
These declarations are duplicated in 2 places, but they're still not
in-scope in the .c files that actually define them. Maybe they should
go in lib/raid/raid6/arm/neon.h, and lib/raid/raid6/arm/pq_arch.h and
lib/raid/raid6/arm64/pq_arch.h should include that?
- Eric
next prev parent reply other threads:[~2026-11-19 22:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 18:33 [PATCH 0/2] raid6/arm64: Use aggregation and 3-way XOR Ard Biesheuvel
2026-11-18 18:33 ` [PATCH 1/2] raid6: neon: process four data disks per Horner step Ard Biesheuvel
2026-11-19 22:44 ` Eric Biggers
2026-11-19 23:51 ` Demian Shulhan
2026-11-18 18:33 ` [PATCH 2/2] raid6: arm64: use the EOR3 instruction where available Ard Biesheuvel
2026-11-19 22:35 ` Eric Biggers [this message]
2026-11-19 23:55 ` Demian Shulhan
2026-11-19 22:50 ` [PATCH 0/2] raid6/arm64: Use aggregation and 3-way XOR Eric Biggers
2026-11-19 23:58 ` Demian Shulhan
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=20261119223513.GB1894@quark \
--to=ebiggers@kernel.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=demyansh@gmail.com \
--cc=hch@lst.de \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.