Re: [PATCH] crypto: powerpc/poly1305 - Restore crypto_simd_usable test

Venkat Rao Bagalkote
2025-05-08T15:06:53Z

On 08/05/25 5:53 pm, Herbert Xu wrote:
> On Thu, May 08, 2025 at 05:27:13PM +0530, Venkat Rao Bagalkote wrote:
>> Yes, its was on the same machine, next-20250506 passed.
> OK I found one bug in my patches, I incorrectly removed the simd
> tests for powerpc. Does this patch help?
>
> ---8<---
> Restore the crypto_simd_usable test as powerpc needs it.
>
> Fixes: 14d31979145d ("crypto: powerpc/poly1305 - Add block-only interface")
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/arch/powerpc/lib/crypto/poly1305-p10-glue.c b/arch/powerpc/lib/crypto/poly1305-p10-glue.c
> index 7cea0ebcc6bc..154eced0bf9e 100644
> --- a/arch/powerpc/lib/crypto/poly1305-p10-glue.c
> +++ b/arch/powerpc/lib/crypto/poly1305-p10-glue.c
> @@ -6,6 +6,7 @@
> */
> #include <asm/switch_to.h>
> #include <crypto/internal/poly1305.h>
> +#include <crypto/internal/simd.h>
> #include <linux/cpufeature.h>
> #include <linux/jump_label.h>
> #include <linux/kernel.h>
> @@ -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) {
> poly1305_p10le_4blocks(state, src, len);
> src += len - (len % (POLY1305_BLOCK_SIZE * 4));
> len %= POLY1305_BLOCK_SIZE * 4;

Unfortunately, above patch dosent fix the boot warning.

Regards,

Venkat.