[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6Eyvo7z8uHRF46G@gondor.apana.org.au>
Date: Tue, 20 Dec 2022 11:57:50 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Robert Elliott <elliott@....com>
Cc: davem@...emloft.net, Jason@...c4.com, ardb@...nel.org,
ap420073@...il.com, David.Laight@...lab.com, ebiggers@...nel.org,
tim.c.chen@...ux.intel.com, peter@...jl.ca, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
linux-crypto@...r.kernel.org, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [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@...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