Re: [PATCH 0/2] crypto: add new driver for Marvell CESA

2015-04-09 Thread Boris Brezillon
Hi Sebastian, On Thu, 09 Apr 2015 17:34:29 +0200 Sebastian Hesselbarth wrote: > > if you include a bunch of performance measurements, I guess it will help > you to get an agreement of replacing the driver instead of reworking it. Yep, I made some measurements using tcrypt a while ago, I'll pro

Re: [PATCH 0/2] crypto: add new driver for Marvell CESA

2015-04-09 Thread Stephan Mueller
Am Donnerstag, 9. April 2015, 16:58:41 schrieb Boris Brezillon: Hi Boris, >Hello, > >This is an attempt to replace the mv_cesa driver by a new one to address >some limitations of the existing driver. >From a performance and CPU load point of view the most important >limitation is the lack of DMA

Re: [PATCH 0/2] crypto: add new driver for Marvell CESA

2015-04-09 Thread Sebastian Hesselbarth
On 09.04.2015 16:58, Boris Brezillon wrote: This is an attempt to replace the mv_cesa driver by a new one to address some limitations of the existing driver. From a performance and CPU load point of view the most important limitation is the lack of DMA support, thus preventing us from chaining c

Re: [PATCH 0/2] crypto: add new driver for Marvell CESA

2015-04-09 Thread Andrew Lunn
On Thu, Apr 09, 2015 at 04:58:41PM +0200, Boris Brezillon wrote: > Hello, > > This is an attempt to replace the mv_cesa driver by a new one to address > some limitations of the existing driver. > >From a performance and CPU load point of view the most important > limitation is the lack of DMA supp

[PATCH 2/2] crypto: marvell/CESA: update DT bindings documentation

2015-04-09 Thread Boris Brezillon
Document new compatible strings, document the new method to reference the crypto SRAM and deprecate the old one and document the the 'clocks' and 'clock-names' properties. Signed-off-by: Boris Brezillon --- .../devicetree/bindings/crypto/mv_cesa.txt | 50 -- 1 file ch

[PATCH 0/2] crypto: add new driver for Marvell CESA

2015-04-09 Thread Boris Brezillon
Hello, This is an attempt to replace the mv_cesa driver by a new one to address some limitations of the existing driver. >From a performance and CPU load point of view the most important limitation is the lack of DMA support, thus preventing us from chaining crypto operations. I know we usually t

[PATCH v4 16/16] crypto/x86: move SHA-384/512 SSSE3 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. It also changes the prototypes of the core asm functions to be compatible with the base prototype void (sha512_block_fn)(struct sha256_state *sst, u8 const *src, int blocks) so th

[PATCH v4 14/16] crypto/x86: move SHA-1 SSSE3 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/x86/crypto/sha1_ssse3_glue.c | 139 -- 1 file changed, 28 insertions(+), 111 deletions(-) diff --git a/ar

[PATCH v4 01/16] crypto: sha1: implement base layer for SHA-1

2015-04-09 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-1 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. The users need to supply an implementation of void (sh

[PATCH v4 02/16] crypto: sha256: implement base layer for SHA-256

2015-04-09 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-256 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. The users need to supply an implementation of void (

[PATCH v4 12/16] crypto/arm64: move SHA-1 ARMv8 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/sha1-ce-core.S | 33 - arch/arm64/crypto/sha1-ce-glue.c | 151 --- 2 files changed,

[PATCH v4 13/16] crypto/arm64: move SHA-224/256 ARMv8 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/sha2-ce-core.S | 29 +++-- arch/arm64/crypto/sha2-ce-glue.c | 227 +-- 2 files changed, 63 i

[PATCH v4 11/16] crypto/arm: move SHA-224/256 ARMv8 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 2 +- arch/arm/crypto/sha2-ce-core.S | 19 ++--- arch/arm/crypto/sha2-ce-glue.c | 155 +

[PATCH v4 00/16] crypto: SHA glue code consolidation

2015-04-09 Thread Ard Biesheuvel
Hello all, This is v4 of what is now a complete glue code consolidation series for generic, x86, arm and arm64 implementations of SHA-1, SHA-224/256 and SHA-384/512. The purpose is to have a single, canonical implementation of the core logic that gets reused by all versions of the algorithm. Note

[PATCH v4 15/16] crypto/x86: move SHA-224/256 SSSE3 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. It also changes the prototypes of the core asm functions to be compatible with the base prototype void (sha256_block_fn)(struct sha256_state *sst, u8 const *src, int blocks) so tha

[PATCH v4 03/16] crypto: sha512: implement base layer for SHA-512

2015-04-09 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-512 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. The users need to supply an implementation of void (

[PATCH v4 10/16] crypto/arm: move SHA-224/256 ASM/NEON implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/sha256_glue.c | 170 ++--- arch/arm/crypto/sha256_glue.h | 17 +--- arch/arm/crypto/sha2

[PATCH v4 06/16] crypto: sha512-generic: move to generic glue implementation

2015-04-09 Thread Ard Biesheuvel
This updated the generic SHA-512 implementation to use the generic shared SHA-512 glue code. It also implements a .finup hook crypto_sha512_finup() and exports it to other modules. The import and export() functions and the .statesize member are dropped, since the default implementation is perfectl

[PATCH v4 08/16] crypto/arm: move SHA-1 NEON implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/sha1_neon_glue.c | 135 +++ 1 file changed, 24 insertions(+), 111 deletions(-) diff --git a/ar

[PATCH v4 09/16] crypto/arm: move SHA-1 ARMv8 implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 1 - arch/arm/crypto/sha1-ce-core.S | 23 +++-- arch/arm/crypto/sha1-ce-glue.c | 107 ++

[PATCH v4 04/16] crypto: sha1-generic: move to generic glue implementation

2015-04-09 Thread Ard Biesheuvel
This updated the generic SHA-1 implementation to use the generic shared SHA-1 glue code. It also implements a .finup hook crypto_sha1_finup() and exports it to other modules. The import and export() functions and the .statesize member are dropped, since the default implementation is perfectly suit

[PATCH v4 05/16] crypto: sha256-generic: move to generic glue implementation

2015-04-09 Thread Ard Biesheuvel
This updates the generic SHA-256 implementation to use the new shared SHA-256 glue code. It also implements a .finup hook crypto_sha256_finup() and exports it to other modules. The import and export() functions and the .statesize member are dropped, since the default implementation is perfectly su

[PATCH v4 07/16] crypto/arm: move SHA-1 ARM asm implementation to base layer

2015-04-09 Thread Ard Biesheuvel
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/sha1-ce-glue.c | 3 +- arch/arm/{include/asm => }/crypto/sha1.h | 3 + arch/arm/crypto/sha1_glue.c | 112

[PATCH v4] crypto: remove instance when test failed

2015-04-09 Thread Stephan Mueller
A cipher instance is added to the list of instances unconditionally regardless of whether the associated test failed. However, a failed test implies that during another lookup, the cipher instance will be added to the list again as it will not be found by the lookup code. That means that the list

Re: [PATCH v3] crypto: remove instance when test failed

2015-04-09 Thread Stephan Mueller
Am Donnerstag, 9. April 2015, 17:40:35 schrieb Herbert Xu: Hi Herbert, >On Thu, Apr 09, 2015 at 11:22:19AM +0200, Stephan Mueller wrote: >> I tested it and this approach does not work. >> >> If I see that right, the reason for that is the following: The suggestion >> is >> to grab the ref count

Re: [PATCH v3] crypto: remove instance when test failed

2015-04-09 Thread Herbert Xu
On Thu, Apr 09, 2015 at 11:22:19AM +0200, Stephan Mueller wrote: > > I tested it and this approach does not work. > > If I see that right, the reason for that is the following: The suggestion is > to grab the ref count at the start of the function followed by a > __crypto_register_alg. __crypto_

Re: [PATCH v3] crypto: remove instance when test failed

2015-04-09 Thread Stephan Mueller
Am Donnerstag, 9. April 2015, 15:41:41 schrieb Herbert Xu: Hi Herbert, >On Thu, Apr 09, 2015 at 09:36:03AM +0200, Stephan Mueller wrote: >> diff --git a/crypto/algapi.c b/crypto/algapi.c >> index f1d0307..cfca1de 100644 >> --- a/crypto/algapi.c >> +++ b/crypto/algapi.c >> @@ -533,6 +533,13 @@ int

Re: [PATCH v3] crypto: remove instance when test failed

2015-04-09 Thread Herbert Xu
On Thu, Apr 09, 2015 at 09:36:03AM +0200, Stephan Mueller wrote: > > diff --git a/crypto/algapi.c b/crypto/algapi.c > index f1d0307..cfca1de 100644 > --- a/crypto/algapi.c > +++ b/crypto/algapi.c > @@ -533,6 +533,13 @@ int crypto_register_instance(struct crypto_template > *tmpl, > if (IS_ERR

[PATCH v3] crypto: remove instance when test failed

2015-04-09 Thread Stephan Mueller
A cipher instance is added to the list of instances unconditionally regardless of whether the associated test failed. However, a failed test implies that during another lookup, the cipher instance will be added to the list again as it will not be found by the lookup code. That means that the list