From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: David Laight <David.Laight@aculab.com>
Cc: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ebiggers@google.com" <ebiggers@google.com>,
"ardb@kernel.org" <ardb@kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH crypto-stable] crypto: arch/lib - limit simd usage to PAGE_SIZE chunks
Date: Mon, 20 Apr 2020 22:02:31 -0600 [thread overview]
Message-ID: <CAHmME9qfrHVQ+-4HjqCO2TaGF6DNTHmS1max1KcVaP5_QjUDRQ@mail.gmail.com> (raw)
In-Reply-To: <2cdb57f2cdbd49e9bb1034d01d054bb7@AcuMS.aculab.com>
On Mon, Apr 20, 2020 at 2:32 AM David Laight <David.Laight@aculab.com> wrote:
> Maybe kernel_fp_begin() should be passed the address of somewhere
> the address of an fpu save area buffer can be written to.
> Then the pre-emption code can allocate the buffer and save the
> state into it.
>
> However that doesn't solve the problem for non-preemptive kernels.
> The may need a cond_resched() in the loop if it might take 1ms (or so).
>
> kernel_fpu_begin() ought also be passed a parameter saying which
> fpu features are required, and return which are allocated.
> On x86 this could be used to check for AVX512 (etc) which may be
> available in an ISR unless it interrupted inside a kernel_fpu_begin()
> section (etc).
> It would also allow optimisations if only 1 or 2 fpu registers are
> needed (eg for some of the crypto functions) rather than the whole
> fpu register set.
There might be ways to improve lots of FPU things, indeed. This patch
here is just a patch to Herbert's branch in order to make uniform
usage of our existing solution for this, fixing the existing bug. I
wouldn't mind seeing more involved and better solutions in a patchset
for crypto-next.
Will follow up with your suggestion in a different thread, so as not
to block this one.
next prev parent reply other threads:[~2020-04-21 4:02 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 7:57 [PATCH crypto-stable] crypto: arch/lib - limit simd usage to PAGE_SIZE chunks Jason A. Donenfeld
2020-04-20 8:32 ` David Laight
2020-04-21 4:02 ` Jason A. Donenfeld [this message]
2020-04-21 4:14 ` FPU register granularity [Was: Re: [PATCH crypto-stable] crypto: arch/lib - limit simd usage to PAGE_SIZE chunks] Jason A. Donenfeld
2020-04-21 4:25 ` Jason A. Donenfeld
2020-04-21 7:02 ` Ard Biesheuvel
2020-04-21 8:05 ` David Laight
2020-04-21 8:11 ` David Laight
2020-04-22 4:04 ` [PATCH crypto-stable] crypto: arch/lib - limit simd usage to PAGE_SIZE chunks Eric Biggers
2020-04-22 7:23 ` Ard Biesheuvel
2020-04-22 7:38 ` Jason A. Donenfeld
2020-04-22 11:28 ` Sebastian Andrzej Siewior
2020-04-22 19:35 ` Jason A. Donenfeld
2020-04-22 7:32 ` Jason A. Donenfeld
2020-04-22 7:39 ` Ard Biesheuvel
2020-04-22 19:51 ` Jason A. Donenfeld
2020-04-22 20:17 ` Jason A. Donenfeld
2020-04-23 8:45 ` Ard Biesheuvel
2020-04-22 20:03 ` [PATCH crypto-stable v2] crypto: arch - limit simd usage to 4k chunks Jason A. Donenfeld
2020-04-22 22:39 ` Eric Biggers
2020-04-22 23:09 ` Jason A. Donenfeld
2020-04-22 23:18 ` [PATCH crypto-stable v3 1/2] crypto: arch/lib " Jason A. Donenfeld
2020-04-22 23:18 ` [PATCH crypto-stable v3 2/2] crypto: arch/nhpoly1305 - process in explicit " Jason A. Donenfeld
2020-04-23 20:39 ` Eric Biggers
2020-04-23 7:18 ` [PATCH crypto-stable v3 1/2] crypto: arch/lib - limit simd usage to " Ard Biesheuvel
2020-04-23 7:40 ` Christophe Leroy
2020-04-23 7:47 ` Ard Biesheuvel
2020-04-23 18:42 ` Greg KH
2020-04-23 18:47 ` Ard Biesheuvel
2020-04-23 20:23 ` Eric Biggers
2020-04-23 20:49 ` Ard Biesheuvel
2020-04-28 23:09 ` Jason A. Donenfeld
2020-04-30 5:30 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHmME9qfrHVQ+-4HjqCO2TaGF6DNTHmS1max1KcVaP5_QjUDRQ@mail.gmail.com \
--to=jason@zx2c4.com \
--cc=David.Laight@aculab.com \
--cc=ardb@kernel.org \
--cc=ebiggers@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).