From: Huang Ying <ying.huang@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
Sebastian Andrzej Siewior <linux-crypto@ml.breakpoint.cc>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [RFC PATCH crypto] AES: Add support to Intel AES-NI instructions
Date: Wed, 17 Dec 2008 09:14:22 +0800 [thread overview]
Message-ID: <1229476462.5936.314.camel@yhuang-dev.sh.intel.com> (raw)
In-Reply-To: <20081216233128.GA13942@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 1471 bytes --]
On Wed, 2008-12-17 at 07:31 +0800, Herbert Xu wrote:
> On Mon, Dec 15, 2008 at 11:38:01PM +1100, Herbert Xu wrote:
> > On Mon, Dec 15, 2008 at 04:21:06PM +1100, Herbert Xu wrote:
> > >
> > > > a. Do not touch SSE state in soft_irq
> > > > b. Disable/restore soft_irq in kernel_fpu_begin/kernel_fpu_end
> > > > c. Use a per-CPU data structure to save kernel FPU state during
> > > > soft_irq.
>
> > Here's another option
> >
> > d. When we're in interrupt context, schedule a task to perform
> > the encryption asynchronously.
>
> We can also hybridise b. and d.:
>
> e. When we're in interrupt context, if TS is clear, then we defer
> the operation to a thread. Otherwise if user-space has touched
> the FPU we save the state, if not then we simply clear TS. In
> either case we perform the operation immediately and then reset
> TS if user-space didn't touch the FPU.
>
> This is based on the fact that it should be fairly rare for us
> to interrupt a kernel FPU/SSE operation. The common case would
> be interrupting a user process or a kernel context which is not
> engaging in any kernel FPU operations.
Yes. This is a better solution with much better performance. How about
hybridise b. and a.:
f. if TS is clear, then use x86_64 implementation. Otherwise if
user-space has touched the FPU, we save the state, if not then simply
clear TS.
I think that could be simpler to be implemented.
Best Regards,
Huang Ying
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-12-17 1:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-12 4:08 [RFC PATCH crypto] AES: Add support to Intel AES-NI instructions Huang Ying
2008-12-12 19:57 ` Sebastian Andrzej Siewior
2008-12-15 2:19 ` Huang Ying
2008-12-15 3:38 ` Herbert Xu
2008-12-15 5:14 ` Huang Ying
2008-12-15 5:21 ` Herbert Xu
2008-12-15 5:48 ` Huang Ying
2008-12-15 12:38 ` Herbert Xu
2008-12-16 23:31 ` Herbert Xu
2008-12-17 1:14 ` Huang Ying [this message]
2008-12-17 1:26 ` Herbert Xu
2008-12-17 3:33 ` Huang Ying
2008-12-17 3:39 ` Herbert Xu
2008-12-15 18:26 ` Suresh Siddha
2008-12-15 9:07 ` Sebastian Andrzej Siewior
2008-12-15 11:28 ` 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=1229476462.5936.314.camel@yhuang-dev.sh.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@ml.breakpoint.cc \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/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