Re: [PATCH 03/13] crypto: x86/sha - yield FPU context during long loops
From: Herbert Xu
Date: Mon Dec 19 2022 - 22:58:38 EST
On Mon, Dec 19, 2022 at 04:02:13PM -0600, Robert Elliott wrote:
>
> +void __sha1_transform_ssse3(struct sha1_state *state, const u8 *data, int blocks)
> +{
> + if (blocks <= 0)
> + return;
> +
> + kernel_fpu_begin();
> + for (;;) {
> + const int chunks = min(blocks, 4096 / SHA1_BLOCK_SIZE);
> +
> + sha1_transform_ssse3(state->state, data, chunks);
> + data += chunks * SHA1_BLOCK_SIZE;
> + blocks -= chunks;
> +
> + if (blocks <= 0)
> + break;
> +
> + kernel_fpu_yield();
Shouldn't this check the MAY_SLEEP flag?
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt