Re: [PATCH 03/13] crypto: x86/sha - yield FPU context during long loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux