Re: [PATCH 1/3 V2] crypto: Fix the pointer voodoo in unaligned ahash

2014-03-12 Thread Herbert Xu
On Thu, Mar 13, 2014 at 05:01:00AM +0100, Marek Vasut wrote: > On Thursday, March 13, 2014 at 02:56:25 AM, Herbert Xu wrote: > > On Thu, Mar 13, 2014 at 02:20:29AM +0100, Marek Vasut wrote: > > > OK, understood. But shall we not preserve the request intact in case a > > > crypto- api function calle

Re: [PATCH 1/3 V2] crypto: Fix the pointer voodoo in unaligned ahash

2014-03-12 Thread Marek Vasut
On Thursday, March 13, 2014 at 02:56:25 AM, Herbert Xu wrote: > On Thu, Mar 13, 2014 at 02:20:29AM +0100, Marek Vasut wrote: > > OK, understood. But shall we not preserve the request intact in case a > > crypto- api function called crypto_ahash_final() with request which has > > .priv already set?

Re: [PATCH 1/3 V2] crypto: Fix the pointer voodoo in unaligned ahash

2014-03-12 Thread Herbert Xu
On Thu, Mar 13, 2014 at 02:20:29AM +0100, Marek Vasut wrote: > > OK, understood. But shall we not preserve the request intact in case a crypto- > api function called crypto_ahash_final() with request which has .priv already > set? Then we would have really funny corruption of the request going on

[PATCH 3/3 V3] crypto: Simplify the ahash_finup implementation

2014-03-12 Thread Marek Vasut
The ahash_def_finup() can make use of the request save/restore functions, thus make it so. This simplifies the code a little and unifies the code paths. Note that the same remark about free()ing the req->priv applies here, the req->priv can only be free()'d after the original request was restored.

[PATCH 2/3 V3] crypto: Pull out the functions to save/restore request

2014-03-12 Thread Marek Vasut
The functions to save original request within a newly adjusted request and it's counterpart to restore the original request can be re-used by more code in the crypto/ahash.c file. Pull these functions out from the code so they're available. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Fabi

[PATCH 1/3 V3] crypto: Fix the pointer voodoo in unaligned ahash

2014-03-12 Thread Marek Vasut
Add documentation for the pointer voodoo that is happening in crypto/ahash.c in ahash_op_unaligned(). This code is quite confusing, so add a beefy chunk of documentation. Moreover, make sure the mangled request is completely restored after finishing this unaligned operation. This means restoring a

Re: [PATCH 3/3 V2] crypto: Simplify the ahash_finup implementation

2014-03-12 Thread Marek Vasut
On Wednesday, March 12, 2014 at 01:11:01 PM, Herbert Xu wrote: > On Mon, Mar 03, 2014 at 01:21:48AM +0100, Marek Vasut wrote: > > -static void ahash_def_finup_done2(struct crypto_async_request *req, int > > err) +static void ahash_def_finup_done2(struct crypto_async_request > > *areq, int err) > >

Re: [PATCH 1/3 V2] crypto: Fix the pointer voodoo in unaligned ahash

2014-03-12 Thread Marek Vasut
On Wednesday, March 12, 2014 at 01:08:14 PM, Herbert Xu wrote: > On Mon, Mar 03, 2014 at 01:21:46AM +0100, Marek Vasut wrote: > > Add documentation for the pointer voodoo that is happening in > > crypto/ahash.c in ahash_op_unaligned(). This code is quite confusing, so > > add a beefy chunk of docum

[PATCH 2/2] SHA1 transform: x86_64 AVX2 optimization - glue & build-v2

2014-03-12 Thread chandramouli narayanan
This git patch adds the glue, build and configuration changes to include x86_64 AVX2 optimization of SHA1 transform to crypto support. The patch has been tested with 3.14.0-rc1 kernel. Changes from the initial version of this patch are in a) check for BMI2 in addition to AVX2 support since __sha1_

[PATCH 1/2] SHA1 transform: x86_64 AVX2 optimization - assembly code-v2

2014-03-12 Thread chandramouli narayanan
This git patch adds x86_64 AVX2 optimization of SHA1 transform to crypto support. The patch has been tested with 3.14.0-rc1 kernel. On a Haswell desktop, with turbo disabled and all cpus running at maximum frequency, tcrypt shows AVX2 performance improvement from 3% for 256 bytes update to 16% for

Re: [PATCH 1/2] SHA1 transform: x86_64 AVX2 optimization - assembly code

2014-03-12 Thread chandramouli narayanan
On Thu, 2014-03-13 at 02:04 +0800, Herbert Xu wrote: > On Wed, Mar 12, 2014 at 11:02:08AM -0700, chandramouli narayanan wrote: > > On Mon, 2014-03-10 at 20:15 +0800, Herbert Xu wrote: > > > On Thu, Feb 27, 2014 at 09:06:55AM -0800, chandramouli narayanan wrote: > > > > This git patch adds x86_64 AV

Re: [PATCH 1/2] SHA1 transform: x86_64 AVX2 optimization - assembly code

2014-03-12 Thread Herbert Xu
On Wed, Mar 12, 2014 at 11:02:08AM -0700, chandramouli narayanan wrote: > On Mon, 2014-03-10 at 20:15 +0800, Herbert Xu wrote: > > On Thu, Feb 27, 2014 at 09:06:55AM -0800, chandramouli narayanan wrote: > > > This git patch adds x86_64 AVX2 optimization of SHA1 transform > > > to crypto support. Th

Re: [PATCH 1/2] SHA1 transform: x86_64 AVX2 optimization - assembly code

2014-03-12 Thread chandramouli narayanan
On Mon, 2014-03-10 at 20:15 +0800, Herbert Xu wrote: > On Thu, Feb 27, 2014 at 09:06:55AM -0800, chandramouli narayanan wrote: > > This git patch adds x86_64 AVX2 optimization of SHA1 transform > > to crypto support. The patch has been tested with 3.14.0-rc1 > > kernel. > > > > On a Haswell deskto

Re: [RFC PATCH 00/22] staging: add skein/threefish crypto algos

2014-03-12 Thread Jason Cooper
On Tue, Mar 11, 2014 at 09:32:32PM +, Jason Cooper wrote: > To facilitate tinkering with this, One can pull from the following: > > git://git.infradead.org/users/jcooper/linux.git tags/staging-skein-3.14-rc1 > > This is based on v3.14-rc1, and is prone to rebasing based on comments. Hmmm,

Re: [PATCH 3/3 V2] crypto: Simplify the ahash_finup implementation

2014-03-12 Thread Herbert Xu
On Mon, Mar 03, 2014 at 01:21:48AM +0100, Marek Vasut wrote: > > -static void ahash_def_finup_done2(struct crypto_async_request *req, int err) > +static void ahash_def_finup_done2(struct crypto_async_request *areq, int err) Please keep the existing name to be consistent with the rest of the crypto

Re: [PATCH 1/3 V2] crypto: Fix the pointer voodoo in unaligned ahash

2014-03-12 Thread Herbert Xu
On Mon, Mar 03, 2014 at 01:21:46AM +0100, Marek Vasut wrote: > Add documentation for the pointer voodoo that is happening in crypto/ahash.c > in ahash_op_unaligned(). This code is quite confusing, so add a beefy chunk > of documentation. > > Moreover, make sure the mangled request is completely re