From: Huang Ying <ying.huang@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Sebastian Siewior <linux-crypto@ml.breakpoint.cc>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>
Subject: Re: [RFC PATCH crypto 4/4] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform
Date: Fri, 09 Jan 2009 16:54:33 +0800 [thread overview]
Message-ID: <1231491273.5937.94.camel@yhuang-dev.sh.intel.com> (raw)
In-Reply-To: <20090109070144.GA7358@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]
On Fri, 2009-01-09 at 15:01 +0800, Herbert Xu wrote:
> > - ablkcipher asynchronous machanism is used to delay a crypto request
> > to work queue context upon FPU state is using by other kernel
> > context.
>
> Actually I was thinking of something as simple as just using
> cryptd as is. That is, register a blkcipher algorithm for your
> version of cbc-aes, but don't register under the name cbc(aes),
> e.g., register it under the name of __cbc-aes-aesni for both alg
> name and driver name. You can register it under cbc(aes) too
> if you add the fallback in there.
>
> Then for the real thing, just allocate the blkcipher __cbc_*,
> plus the ablkcipher cryptd(__cbc_*), and invoke the right one
> depending on caller context.
I have ever considered this method too. This one is simpler, but the
drawbacks are as follow:
- cryptd thread is not per-CPU, so I think there will be some
unnecessary cache inter-CPU migration. Why not use a dedicate workqueue
or just system events workqueue?
- with cryptd(__*-aes-aesni), we need 4 internal tfms for each external
tfm allocation request. For example, for one external cbc(aes) tfm
allocation request, we need one cbc(aes) ablkcipher tfm, one
cryptd(cbc-aes-aesni) tfm, and two cbc-aes-aesni tfm. Do we use too much
memory? And we need to call aesni_set_key() twice.
> This is even simpler for the modes which you don't implement.
> In that case you would just allocate FOO(aes-aesni) in conjunction
> with cryptd(FOO(aes-aesni)).
Yes. This is really a simple method.
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:[~2009-01-09 8:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 2:02 [RFC PATCH crypto 4/4] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform Huang Ying
2009-01-09 7:01 ` Herbert Xu
2009-01-09 8:54 ` Huang Ying [this message]
2009-01-09 9:18 ` Herbert Xu
2009-01-10 10:08 ` Herbert Xu
2009-01-12 2:30 ` Huang Ying
2009-01-12 3:06 ` Herbert Xu
2009-01-12 6:55 ` Huang Ying
2009-01-12 10:43 ` Herbert Xu
2009-01-13 2:34 ` Huang Ying
2009-01-13 2:39 ` Herbert Xu
2009-01-13 2:49 ` Huang Ying
2009-01-13 2:53 ` 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=1231491273.5937.94.camel@yhuang-dev.sh.intel.com \
--to=ying.huang@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@ml.breakpoint.cc \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@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