[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250510223401.GK30295@gate.crashing.org>
Date: Sat, 10 May 2025 17:34:01 -0500
From: Segher Boessenkool <segher@...nel.crashing.org>
To: Eric Biggers <ebiggers@...nel.org>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
Venkat Rao Bagalkote <venkat88@...ux.ibm.com>,
Thorsten Leemhuis <linux@...mhuis.info>,
Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Danny Tsen <dtsen@...ux.ibm.com>, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [v2 PATCH] crypto: powerpc/poly1305 - Add poly1305_emit_arch wrapper
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
Powered by blists - more mailing lists