From: Segher Boessenkool <segher@kernel.crashing.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
Thorsten Leemhuis <linux@leemhuis.info>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Danny Tsen <dtsen@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [v2 PATCH] crypto: powerpc/poly1305 - Add poly1305_emit_arch wrapper
Date: Sat, 10 May 2025 17:34:01 -0500 [thread overview]
Message-ID: <20250510223401.GK30295@gate.crashing.org> (raw)
In-Reply-To: <20250510053308.GB505731@sol>
Hi!
On Fri, May 09, 2025 at 10:33:08PM -0700, Eric Biggers wrote:
> On Sat, May 10, 2025 at 01:10:22PM +0800, Herbert Xu wrote:
> > On Fri, May 09, 2025 at 09:44:50PM -0700, Eric Biggers wrote:
> > >
> > > This fixes "-cpu Power10", but older CPUs (e.g. "-cpu POWER9") are still
> > > failing.
> >
> > You're right. I'll revert this and apply the following patch
> > instead.
> >
> > BTW this thing is still hopelessly broken if it's called from
> > softirq context because there is no SIMD fallback. Yes I removed
> > the SIMD check but it was already broken before that as it simply
> > switched from the 4-block version to the 1-block version if SIMD
> > is not available rather than actually doing something that is
> > safe in softirq context.
> >
> > Perhaps we should just remove this altogether until it's fixed.
>
> Yes, the PowerPC Poly1305 code incorrectly uses VSX without first checking
> crypto_simd_usable(). And PowerPC also doesn't support VSX in softirqs, or at
> least it doesn't claim to (it doesn't override may_use_simd(), so it gets the
> default from include/asm-generic/simd.h which returns false in softirq context).
> Maybe add 'depends on BROKEN' to CRYPTO_POLY1305_P10 for now, and give the
> PowerPC folks (Cc'ed) a chance to fix this before removing the code.
What doe "may_use_simd" even *mean*? At its declaration site it says
"whether it is allowable at this time to issue SIMD instructions or
access the SIMD register file", but that is 100% meaningless, you can do
SIMD in GPRs.
On PowerPC we have two separate register files dedicated to SIMD-like
stuff, the VMX and the VSX register files. Which of those is this
function supposed to care about?
It looks like the whole "may_use_simd" thing is a misguided abstraction
unfortunately :-(
Segher
next prev parent reply other threads:[~2025-05-10 22:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <242ebbf1-4ef0-41c3-83cb-a055c262ba4a@leemhuis.info>
[not found] ` <aBtF2jVZQwxGiHVk@gondor.apana.org.au>
[not found] ` <37cf099e-d5c2-40d8-bc31-77e1f9623b1c@linux.ibm.com>
[not found] ` <aByX_Y64C6lVRR8M@gondor.apana.org.au>
[not found] ` <f66620e2-77e3-4713-a946-ddb2c8a0bccb@linux.ibm.com>
[not found] ` <aByiNZNxqyTerdYG@gondor.apana.org.au>
[not found] ` <1d2c2fdc-5c36-4d4e-8b25-8289b865726d@linux.ibm.com>
[not found] ` <aB31DI4QBBZuQObQ@gondor.apana.org.au>
[not found] ` <20250510044450.GA505731@sol>
[not found] ` <aB7fvi_FBdnmLUON@gondor.apana.org.au>
2025-05-10 5:33 ` [v2 PATCH] crypto: powerpc/poly1305 - Add poly1305_emit_arch wrapper Eric Biggers
2025-05-10 5:49 ` Herbert Xu
2025-05-10 5:50 ` Herbert Xu
2025-05-10 6:02 ` Eric Biggers
2025-05-10 9:13 ` [PATCH] crypto: powerpc/poly1305 - Add SIMD fallback Herbert Xu
2025-05-10 22:34 ` Segher Boessenkool [this message]
2025-05-10 23:19 ` [v2 PATCH] crypto: powerpc/poly1305 - Add poly1305_emit_arch wrapper Eric Biggers
2025-05-11 2:10 ` Herbert Xu
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=20250510223401.GK30295@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=dtsen@linux.ibm.com \
--cc=ebiggers@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux@leemhuis.info \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=sfr@canb.auug.org.au \
--cc=venkat88@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).