[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aB4ONRiTNjHpCw6U@gondor.apana.org.au>
Date: Fri, 9 May 2025 22:16:21 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Venkat Rao Bagalkote <venkat88@...ux.ibm.com>
Cc: 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>,
Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH] crypto: powerpc/poly1305 - Restore crypto_simd_usable
test
On Thu, May 08, 2025 at 08:23:17PM +0800, Herbert Xu wrote:
>
> @@ -51,7 +52,7 @@ void poly1305_blocks_arch(struct poly1305_block_state *state, const u8 *src,
> if (!static_key_enabled(&have_p10))
> return poly1305_blocks_generic(state, src, len, padbit);
> vsx_begin();
> - if (len >= POLY1305_BLOCK_SIZE * 4) {
> + if (crypto_simd_usable() && len >= POLY1305_BLOCK_SIZE * 4) {
This patch is obviously broken. However, I think this code was
always broken in the SIMD-fallback case. AFAICS the fallback
uses vector instructions so it can't be used in softirqs either.
A proper fallback would have to convert the state to the format
used by the generic poly1305 implementation, call that, and then
convert it back.
Of course it would be a lot easier if ppc could make VSX usable
in softirq context.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists