lkml.org 
[lkml]   [2022]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/13] crypto: x86/sha - yield FPU context during long loops
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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2023-03-26 23:15    [W:0.201 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site