[PATCH crypto -v6 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Huang Ying
Intel AES-NI is a new set of Single Instruction Multiple Data (SIMD) instructions that are going to be introduced in the next generation of Intel processor, as of 2009. These instructions enable fast and secure data encryption and decryption, using the Advanced Encryption Standard (AES), defined by

[PATCH crypto -v6 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Huang Ying
cryptd_alloc_ablkcipher() will allocate a cryptd-ed ablkcipher for specified algorithm name. The new allocated one is guaranteed to be cryptd-ed ablkcipher, so the blkcipher underlying can be gotten via cryptd_ablkcipher_child(). v5: - Move declaration to crypto/cryptd.h - Fix allocation error

Re: [PATCH crypto -v5 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Herbert Xu
On Fri, Jan 16, 2009 at 03:10:20PM +0800, Huang Ying wrote: > > v5: > > - Move declaration to crypto/cryptd.h > > - Fix allocation error processing in cryptd_alloc_ablkcipher() > > Signed-off-by: Huang Ying OK we're nearly there :) > +struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const ch

[PATCH crypto -v5 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Huang Ying
Intel AES-NI is a new set of Single Instruction Multiple Data (SIMD) instructions that are going to be introduced in the next generation of Intel processor, as of 2009. These instructions enable fast and secure data encryption and decryption, using the Advanced Encryption Standard (AES), defined by

[PATCH crypto -v5 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Huang Ying
cryptd_alloc_ablkcipher() will allocate a cryptd-ed ablkcipher for specified algorithm name. The new allocated one is guaranteed to be cryptd-ed ablkcipher, so the blkcipher underlying can be gotten via cryptd_ablkcipher_child(). v5: - Move declaration to crypto/cryptd.h - Fix allocation error

Re: [PATCH] crypto: compress - Add pcomp interface

2009-01-15 Thread Herbert Xu
On Thu, Jan 15, 2009 at 11:54:53AM +0100, Geert Uytterhoeven wrote: > > But there are pr_debug()s ;-) Well they must've turned invisible in the copy I received :) > By "both alloc function", do you mean the .setup_comp() and .setup_decomp() > functions? If yes, then I understand. Yes. > (Yester

Re: [PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Herbert Xu
On Fri, Jan 16, 2009 at 11:37:25AM +0800, Huang Ying wrote: > > I think Roel Kluin is the real reporter. OK I'll add him as well. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.

Re: [PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Huang Ying
On Fri, 2009-01-16 at 11:26 +0800, Herbert Xu wrote: > On Fri, Jan 16, 2009 at 10:37:02AM +0800, Huang Ying wrote: > > > > But after checking blkcipher_walk_done() in 2.6.28, If input argument > > err != 0 and walk->flags & BLKCIPHER_WALK_SLOW != 0, when > > blkcipher_walk_done() return non-zero, w

Re: [RFC] per-CPU cryptd thread implementation based on workqueue

2009-01-15 Thread Herbert Xu
On Fri, Jan 16, 2009 at 11:10:36AM +0800, Huang Ying wrote: > > The scalability of current cryptd implementation is not good. So a > per-CPU cryptd kthread implementation is necessary. The per-CPU kthread > pool implementation need to consider many issues such as CPU hotplug, so > I suggest to bas

Re: [PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Herbert Xu
On Fri, Jan 16, 2009 at 10:37:02AM +0800, Huang Ying wrote: > > But after checking blkcipher_walk_done() in 2.6.28, If input argument > err != 0 and walk->flags & BLKCIPHER_WALK_SLOW != 0, when > blkcipher_walk_done() return non-zero, walk->nbytes != 0. So I think it > is a little fragile to use wa

[RFC] per-CPU cryptd thread implementation based on workqueue

2009-01-15 Thread Huang Ying
Hi, Herbert, The scalability of current cryptd implementation is not good. So a per-CPU cryptd kthread implementation is necessary. The per-CPU kthread pool implementation need to consider many issues such as CPU hotplug, so I suggest to base cryptd kthread implementation on workqueue, that is, cr

Re: [PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Huang Ying
On Fri, 2009-01-16 at 09:53 +0800, Herbert Xu wrote: > On Fri, Jan 16, 2009 at 09:20:58AM +0800, Huang Ying wrote: > > On Thu, 2009-01-15 at 17:47 +0800, roel kluin wrote: > > > > > > + kernel_fpu_begin(); > > > > + while ((nbytes = walk.nbytes)) { > > > > + aesni_ecb_enc(

Re: [PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Herbert Xu
On Fri, Jan 16, 2009 at 09:20:58AM +0800, Huang Ying wrote: > On Thu, 2009-01-15 at 17:47 +0800, roel kluin wrote: > > > > + kernel_fpu_begin(); > > > + while ((nbytes = walk.nbytes)) { > > > + aesni_ecb_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr, > > > +

Re: [PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Huang Ying
On Thu, 2009-01-15 at 17:47 +0800, roel kluin wrote: > Sorry to bother, > > > +static int ecb_encrypt(struct blkcipher_desc *desc, > > + struct scatterlist *dst, struct scatterlist *src, > > + unsigned int nbytes) > > +{ > > + struct crypto_aes_ctx *

Re: [PATCH] crypto: compress - Add pcomp interface

2009-01-15 Thread Geert Uytterhoeven
Hi Herbert, On Thu, 15 Jan 2009, Herbert Xu wrote: > On Wed, Jan 14, 2009 at 04:01:34PM +0100, Geert Uytterhoeven wrote: > > It's used by the pr_*() macros in . > > > > Since commit d091c2f58ba32029495a933b721e8e02fbd12caa ("Add 'pr_fmt()' > > format > > modifier to pr_xyz macros."), thi

Re: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Herbert Xu
On Thu, Jan 15, 2009 at 05:30:51PM +0800, Huang Ying wrote: > > > > Why do we need this check? Someone else may register cryptd template? > > > Which error number should be return? -EINVAL? > > > > -ENOMEM for example. > > You mean something as follow: > > if (crypto_ablkcipher_tfm(tfm)->__crt_a

Re: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Huang Ying
On Thu, 2009-01-15 at 17:23 +0800, Herbert Xu wrote: > On Thu, Jan 15, 2009 at 05:21:47PM +0800, Huang Ying wrote: > > On Thu, 2009-01-15 at 16:47 +0800, Herbert Xu wrote: > > > On Thu, Jan 15, 2009 at 04:28:33PM +0800, Huang Ying wrote: > > > > > > > > + tfm = crypto_alloc_ablkcipher(cryptd_

Re: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Herbert Xu
On Thu, Jan 15, 2009 at 05:21:47PM +0800, Huang Ying wrote: > On Thu, 2009-01-15 at 16:47 +0800, Herbert Xu wrote: > > On Thu, Jan 15, 2009 at 04:28:33PM +0800, Huang Ying wrote: > > > > > > + tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask); > > > + BUG_ON(crypto_ablkcipher_tfm(tfm)->__c

Re: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Huang Ying
On Thu, 2009-01-15 at 16:47 +0800, Herbert Xu wrote: > On Thu, Jan 15, 2009 at 04:28:33PM +0800, Huang Ying wrote: > > > > + tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask); > > + BUG_ON(crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module != > > + THIS_MODULE); > > You need t

Re: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Herbert Xu
On Thu, Jan 15, 2009 at 04:28:33PM +0800, Huang Ying wrote: > > + tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask); > + BUG_ON(crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module != > +THIS_MODULE); You need to check whether tfm is an error before dereferencing it. Also

[PATCH crypto -v4 1/2] AES-NI: Add support to access underlying blkcipher under cryptd ablkcipher

2009-01-15 Thread Huang Ying
cryptd_alloc_ablkcipher() will allocate a cryptd-ed ablkcipher for specified algorithm name. The new allocated one is guaranteed to be cryptd-ed ablkcipher, so the blkcipher underlying can be gotten via cryptd_ablkcipher_child(). Signed-off-by: Huang Ying --- crypto/cryptd.c | 30

[PATCH crypto -v4 2/2] AES-NI: Add support to Intel AES-NI instructions for x86_64 platform

2009-01-15 Thread Huang Ying
Intel AES-NI is a new set of Single Instruction Multiple Data (SIMD) instructions that are going to be introduced in the next generation of Intel processor, as of 2009. These instructions enable fast and secure data encryption and decryption, using the Advanced Encryption Standard (AES), defined by