Re: [PATCH 1/5] random: fix crng_ready() test

2018-05-17 Thread Christophe LEROY
Le 13/04/2018 à 19:00, Theodore Y. Ts'o a écrit : On Fri, Apr 13, 2018 at 03:05:01PM +0200, Stephan Mueller wrote: What I would like to point out that more and more folks change to getrandom(2). As this call will now unblock much later in the boot cycle, these systems see a significant

Re: [PATCH] crypto: talitos - fix IPsec cipher in length

2018-03-22 Thread Christophe LEROY
Le 16/03/2018 à 15:07, Horia Geantă a écrit : On 3/16/2018 2:42 PM, Christophe LEROY wrote: Le 16/03/2018 à 09:48, Horia Geantă a écrit : For SEC 2.x+, cipher in length must contain only the ciphertext length. In case of using hardware ICV checking, the ICV length is provided via the "e

[PATCH v2] crypto: talitos - fix IPsec cipher in length

2018-03-22 Thread Christophe Leroy
t AEAD for SEC1 using HMAC_SNOOP_NO_AFEU") Reported-by: Horia Geantă <horia.gea...@nxp.com> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --gi

Re: [PATCH 9/9] crypto: talitos - don't leak pointers to authenc keys

2018-03-22 Thread Christophe LEROY
Le 21/03/2018 à 18:00, Tudor Ambarus a écrit : Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> Reviewed-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/talitos.c b/dr

Re: [PATCH] crypto: talitos - fix IPsec cipher in length

2018-03-16 Thread Christophe LEROY
Le 16/03/2018 à 09:48, Horia Geantă a écrit : For SEC 2.x+, cipher in length must contain only the ciphertext length. In case of using hardware ICV checking, the ICV length is provided via the "extent" field of the descriptor pointer. Cc: # 4.8+ Fixes: 549bd8bc5987

Re: [PATCH 2/2] crypto: talitos: Delete an error message for a failed memory allocation in talitos_edesc_alloc()

2018-03-12 Thread Christophe LEROY
ed-off-by: Markus Elfring <elfr...@users.sourceforge.net> Reviewed-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index a2271322db34..4c7318981d28 100644 --

Re: [PATCH 1/2] crypto: talitos: Use common error handling code in talitos_edesc_alloc()

2018-03-12 Thread Christophe LEROY
Le 12/03/2018 à 14:31, SF Markus Elfring a écrit : From: Markus Elfring Date: Mon, 12 Mar 2018 14:08:55 +0100 Add jump targets so that an error message and the setting of a specific error code is stored only once at the end of this function. Signed-off-by:

Re: [PATCH 17/18] crypto: talitos - chain in buffered data for ahash on SEC1

2018-03-02 Thread Christophe LEROY
Le 02/03/2018 à 18:27, Horia Geantă a écrit : On 10/6/2017 4:05 PM, Christophe Leroy wrote: [...] @@ -1778,6 +1814,36 @@ static int common_nonsnoop_hash(struct talitos_edesc *edesc, if (is_sec1 && from_talitos_ptr_len(>ptr[3], true) == 0) talitos_handle_bug

[PATCH 1/2] crypto: talitos - don't persistently map req_ctx->hw_context and req_ctx->buf

2018-02-26 Thread Christophe Leroy
@nxp.com> Fixes: 49f9783b0cea ("crypto: talitos - do hw_context DMA mapping outside the requests") Fixes: 37b5e8897eb5 ("crypto: talitos - chain in buffered data for ahash on SEC1") Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 1

[PATCH 2/2] crypto: talitos - do not perform unnecessary dma synchronisation

2018-02-26 Thread Christophe Leroy
req_ctx->hw_context is mainly used only by the HW. So it is not needed to sync the HW and the CPU each time hw_context in DMA mapped. This patch modifies the DMA mapping in order to limit synchronisation to necessary situations. Signed-off-by: Christophe Leroy <christophe.le...@

Re: [PATCH 4.14, 4.9] crypto: talitos - fix Kernel Oops on hashing an empty file

2018-02-22 Thread Christophe LEROY
Le 22/02/2018 à 09:30, Horia Geantă a écrit : On 2/22/2018 9:08 AM, Christophe Leroy wrote: Upstream 87a81dce53b1ea61acaeefa5191a0376a2d1d721 Performing the hash of an empty file leads to a kernel Oops [ 44.504600] Unable to handle kernel paging request for data at address 0x000c

[PATCH 4.14, 4.9] crypto: talitos - fix Kernel Oops on hashing an empty file

2018-02-21 Thread Christophe Leroy
3f01bc <8129000c> b39e003a 7d29c214 913e003c This patch fixes that Oops by checking if src is NULL. Fixes: 6a1e8d14156d4 ("crypto: talitos - making mapping helpers more generic") Cc: <sta...@vger.kernel.org> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr>

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Christophe LEROY
Le 19/02/2018 à 09:30, Horia Geantă a écrit : On 2/19/2018 9:58 AM, Christophe LEROY wrote: Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx should be done in the last states of the hash flows described here

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-18 Thread Christophe LEROY
Le 18/02/2018 à 18:14, Horia Geantă a écrit : On 2/17/2018 6:32 PM, Christophe LEROY wrote: Le 07/02/2018 à 15:39, Horia Geantă a écrit : On 10/6/2017 4:06 PM, Christophe Leroy wrote: At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-17 Thread Christophe LEROY
Le 07/02/2018 à 15:39, Horia Geantă a écrit : On 10/6/2017 4:06 PM, Christophe Leroy wrote: At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping in functions ahash_init() and ahash_import(). Signed-off-by: Christophe Leroy <christophe

[PATCH] crypto: talitos: fix Kernel Oops on hashing an empty file

2018-01-26 Thread Christophe Leroy
This patch fixes that Oops by checking if src is NULL. Fixes: 6a1e8d14156d4 ("crypto: talitos - making mapping helpers more generic") Cc: <sta...@vger.kernel.org> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 4 1 file ch

Re: [PATCH v9 17/20] crypto: talitos: move to generic async completion

2017-10-17 Thread Christophe LEROY
Le 15/10/2017 à 11:20, Gilad Ben-Yossef a écrit : The talitos driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Tested-by: Christophe Leroy <christophe.le.

Re: md5sum (from libkcapi) fails on kernel 4.9 but not on 4.13

2017-10-17 Thread Christophe LEROY
Hi Again Stephan Le 17/10/2017 à 09:58, Christophe LEROY a écrit : Hi Stephan, Le 16/10/2017 à 23:10, Stephan Mueller a écrit : Am Montag, 16. Oktober 2017, 08:53:00 CEST schrieb Christophe LEROY: Hi Christophe, Hi Stephan, I get an issue with md5sum of a big file with kernel 4.9

Re: md5sum (from libkcapi) fails on kernel 4.9 but not on 4.13

2017-10-17 Thread Christophe LEROY
Hi Stephan, Le 16/10/2017 à 23:10, Stephan Mueller a écrit : Am Montag, 16. Oktober 2017, 08:53:00 CEST schrieb Christophe LEROY: Hi Christophe, Hi Stephan, I get an issue with md5sum of a big file with kernel 4.9. It don't get that issue with kernel 4.13. The key to the difference

md5sum (from libkcapi) fails on kernel 4.9 but not on 4.13

2017-10-16 Thread Christophe LEROY
Hi Stephan, I get an issue with md5sum of a big file with kernel 4.9. It don't get that issue with kernel 4.13. When I do an strace, I see a difference in the calls: at the end of the file, with 4.9 md5sum uses sendmsg() for the last block while with 4.13 it uses splice() as for all the

[PATCH 00/18] crypto: talitos - fixes and performance improvement

2017-10-06 Thread Christophe Leroy
before the last, it divides by 2 the time needed for a md5 hash on the SEC1. Christophe Leroy (18): crypto: talitos - fix AEAD test failures crypto: talitos - fix memory corruption on SEC2 crypto: talitos - fix setkey to check key weakness crypto: talitos - fix AEAD for sha224 on non sha224

[PATCH 01/18] crypto: talitos - fix AEAD test failures

2017-10-06 Thread Christophe Leroy
-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index dff88838dce7..cd8a37e60259 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/tal

[PATCH 05/18] crypto: talitos - fix use of sg_link_tbl_len

2017-10-06 Thread Christophe Leroy
sg_link_tbl_len shall be used instead of cryptlen, otherwise SECs which perform HW CICV verification will fail. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/tal

[PATCH 03/18] crypto: talitos - fix setkey to check key weakness

2017-10-06 Thread Christophe Leroy
-talitos: flags=100 This is due to setkey being expected to detect weak keys. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 1e7998

[PATCH 04/18] crypto: talitos - fix AEAD for sha224 on non sha224 capable chips

2017-10-06 Thread Christophe Leroy
-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 8aa1212086f4..b7184f305867 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -

[PATCH 02/18] crypto: talitos - fix memory corruption on SEC2

2017-10-06 Thread Christophe Leroy
all cases. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 42 -- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index cd8a37e60259..1e799886c5

[PATCH 08/18] crypto: talitos - declare local functions static

2017-10-06 Thread Christophe Leroy
talitos_handle_buggy_hash() and talitos_sg_map() are only used locally, make them static Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/

[PATCH 09/18] crypto: talitos - use devm_kmalloc()

2017-10-06 Thread Christophe Leroy
Replace kmalloc() by devm_kmalloc() Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index dd6b1f

[PATCH 12/18] crypto: talitos - don't check the number of channels at each interrupt

2017-10-06 Thread Christophe Leroy
The number of channels is known from the beginning, no need to test it everytime. This patch defines two additional done functions handling only channel 0. Then the probe registers the correct one based on the number of channels. Signed-off-by: Christophe Leroy <christophe.le...@c-s

[PATCH 10/18] crypto: talitos - use of_property_read_u32()

2017-10-06 Thread Christophe Leroy
Use of_property_read_u32() to simplify DT read Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 2a53d0

[PATCH 14/18] crypto: talitos - simplify tests in ipsec_esp()

2017-10-06 Thread Christophe Leroy
Do (desc->hdr & DESC_HDR_TYPE_IPSEC_ESP) only once. Limit number of if/else paths Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 42 -- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/d

[PATCH 15/18] crypto: talitos - DMA map key in setkey()

2017-10-06 Thread Christophe Leroy
dma_map_single() is an heavy operation which doesn't need to be done at each request as the key doesn't change. Instead of DMA mapping the key at every request, this patch maps it once in setkey() Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.

[PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2017-10-06 Thread Christophe Leroy
At every request, we map and unmap the same hash hw_context. This patch moves the dma mapping/unmapping in functions ahash_init() and ahash_import(). Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 80 ++---

[PATCH 13/18] crypto: talitos - remove to_talitos_ptr_len()

2017-10-06 Thread Christophe Leroy
to_talitos_ptr() and to_talitos_ptr_len() are always called together in order to fully set a ptr, so lets merge them into a single helper. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 56 ++-- 1 file c

[PATCH 18/18] crypto: talitos - avoid useless copy

2017-10-06 Thread Christophe Leroy
This patch avoids copy of buffered data to hash from bufnext to buf Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 36 ++-- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/talitos.c b/d

Re: [PATCH 5/6] crypto: talitos - use kzalloc instead of kmalloc

2017-10-05 Thread Christophe LEROY
Le 21/09/2017 à 09:19, Christophe Leroy a écrit : Use kzalloc() to zeroize the extended descriptor at allocation and further zeorising This patch significantly degrades performances. I will submit a new serie soon. Christophe Signed-off-by: Christophe Leroy <christophe.le...@c-s

Re: Question about ahash export and import

2017-09-27 Thread Christophe LEROY
Le 27/09/2017 à 11:08, Herbert Xu a écrit : On Tue, Sep 26, 2017 at 01:09:05PM +0200, Kamil Konieczny wrote: Can import() be called without _any_ init(), for example after reboot of machine ? Is following scenario valid: Of course it can. import must restore the state of the request to

Question about ahash export and import

2017-09-26 Thread Christophe LEROY
Hello, Today, the talitos driver dma maps/unmaps context and keys at every single request. I'm looking at doing the dma mapping at hash init and doing unmapping at final/finup/digest However, I'm wondering how to manage hash exports and imports. I was initially thinking about doing a

[PATCH] crypto: talitos - fix setkey to check key weakness

2017-09-25 Thread Christophe Leroy
-talitos: flags=100 This is due to setkey being expected to detect weak keys. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index e7e31f

[PATCH] crypto: talitos - fix AEAD for sha224 on non sha224 capable chips

2017-09-25 Thread Christophe Leroy
-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 09a2cd3a31d2..9bfda9d59ace 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -

[PATCH 6/6] crypto: talitos - fix memory corruption on SEC2

2017-09-21 Thread Christophe Leroy
all cases. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index a5b608b54c74..e7e31f8fd3

[PATCH 5/6] crypto: talitos - use kzalloc instead of kmalloc

2017-09-21 Thread Christophe Leroy
Use kzalloc() to zeroize the extended descriptor at allocation and further zeorising Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 23 +-- drivers/crypto/talitos.h | 2 -- 2 files changed, 1 insertion(+), 24 deletions(-) diff

[PATCH 3/6] crypto: talitos - fix sha224

2017-09-21 Thread Christophe Leroy
Kernel crypto tests report the following error at startup [2.752626] alg: hash: Test 4 failed for sha224-talitos [2.757907] : 30 e2 86 e2 e7 8a dd 0d d7 eb 9f d5 83 fe f1 b0 0010: 2d 5a 6c a5 f9 55 ea fd 0e 72 05 22 This patch fixes it Signed-off-by: Christophe Leroy

[PATCH 2/6] crypto: talitos - fix hashing

2017-09-21 Thread Christophe Leroy
md5sum on some files gives wrong result Exemple: With the md5sum from libkcapi: c15115c05bad51113f81bdaee735dd09 test With the original md5sum: bbdf41d80ba7e8b2b7be3a0772be76cb test This patch fixes this issue Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/

[PATCH 0/6] crypto: talitos - various fixes

2017-09-21 Thread Christophe Leroy
This serie provide various fixes on the talitos driver. Christophe Leroy (6): crypto: talitos - Don't provide setkey for non hmac hashing algs. crypto: talitos - fix hashing crypto: talitos - fix sha224 crypto: talitos - fix AEAD test failures crypto: talitos - use kzalloc instead

[PATCH 1/6] crypto: talitos - Don't provide setkey for non hmac hashing algs.

2017-09-21 Thread Christophe Leroy
at setkey() function is set only for hmac hashing. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 79791c690858..5cc1600

Re: [PATCH 0/6] crypto: talitos - various fixes

2017-09-20 Thread christophe leroy
What's going wrong ? I have resent it and it the same again, the serie is not dispatched on the linux-crypto list, but when I answer to a mail of the serie, the answer shows up. What could be the issue ? Christophe Le 20/09/2017 à 10:35, Christophe LEROY a écrit : Looks like the linux-crypto

Test

2017-09-20 Thread Christophe LEROY
Sorry for the noise, but I have twice tried to send a PATCH serie to this list with a copy to linuxppc-...@lists.ozlabs.org, it appears properly in the linuxppc list/patchwork but it still doesn't appear on linux-crypto. Is there anything wrong with the list ? Christophe

Re: [PATCH 0/6] crypto: talitos - various fixes

2017-09-20 Thread Christophe LEROY
Looks like the linux-crypto list and patchwork was out of order when I sent this. I will send again, sorry for the noise on the other lists. Le 19/09/2017 à 14:58, Christophe Leroy a écrit : This serie provide various fixes on the talitos driver. Christophe Leroy (6): crypto: talitos

[PATCH] crypto: talitos - fix hashing

2017-09-13 Thread Christophe Leroy
md5sum on some files gives wrong result Exemple: With the md5sum from libkcapi: c15115c05bad51113f81bdaee735dd09 test With the original md5sum: bbdf41d80ba7e8b2b7be3a0772be76cb test This patch fixes this issue Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/

[PATCH] crypto: talitos - fix sha224

2017-09-13 Thread Christophe Leroy
Kernel crypto tests report the following error at startup [2.752626] alg: hash: Test 4 failed for sha224-talitos [2.757907] : 30 e2 86 e2 e7 8a dd 0d d7 eb 9f d5 83 fe f1 b0 0010: 2d 5a 6c a5 f9 55 ea fd 0e 72 05 22 This patch fixes it Signed-off-by: Christophe Leroy

Re: md5sum (from libkcapi) fails as splice() returns -ENOKEY

2017-09-12 Thread Christophe LEROY
Hi again Le 12/09/2017 à 09:22, Stephan Mueller a écrit : Am Dienstag, 12. September 2017, 09:20:41 CEST schrieb Stephan Mueller: I am thinking now to add AC_PREREQ([2.60]) to configure.ac. I meant 2.69, of course? :-) Ok ... CentOS ships with 2.63 and no update seems available via 'yum

Re: md5sum (from libkcapi) fails as splice() returns -ENOKEY

2017-09-12 Thread Christophe LEROY
Hi Stephan, Le 12/09/2017 à 09:20, Stephan Mueller a écrit : Am Dienstag, 12. September 2017, 09:01:08 CEST schrieb Christophe LEROY: Hi Christophe, Hi Stephan Le 11/09/2017 à 21:17, Stephan Müller a écrit : Am Montag, 11. September 2017, 19:07:31 CEST schrieb christophe leroy: Hi

[PATCH] crypto: talitos - Don't provide setkey for non hmac hashing algs.

2017-09-12 Thread Christophe Leroy
at setkey() function is set only for hmac hashing. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 79791c690858..5cc1600

Re: md5sum (from libkcapi) fails as splice() returns -ENOKEY

2017-09-12 Thread Christophe LEROY
Hi Stephan Le 11/09/2017 à 21:17, Stephan Müller a écrit : Am Montag, 11. September 2017, 19:07:31 CEST schrieb christophe leroy: Hi christophe, Hello Stephan, I'm trying to use md5sum from the latest libkcapi 0.14 and I getting a failure with return code -5. What am I missing ? See strace

md5sum (from libkcapi) fails as splice() returns -ENOKEY

2017-09-11 Thread christophe leroy
Hello Stephan, I'm trying to use md5sum from the latest libkcapi 0.14 and I getting a failure with return code -5. What am I missing ? See strace below, splice() return -ENOKEY. Christophe execve("./md5sum", ["./md5sum", "kcapi.tar"], [/* 11 vars */]) = 0 brk(0)

[PATCH v2 4/7] crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU

2016-06-06 Thread Christophe Leroy
has CICV out in pointer 6 * HMAC_SNOOP_NO_AFEU has no primary EU context out so we get it from the end of data out Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 209 --- 1 file changed, 124 insertions(

[PATCH v2 0/7] crypto: talitos - implementation of AEAD for SEC1

2016-06-06 Thread Christophe Leroy
r the move. * reworked the DMA sync associated with mapping in order to not spend time syncing several times Christophe Leroy (7): crypto: talitos - using helpers for all talitos_ptr operations crypto: talitos - move mapping helpers before IPSEC functions crypto: talitos - making mapping helpers mo

[PATCH v2 6/7] crypto: talitos - implement cra_priority

2016-06-06 Thread Christophe Leroy
IPSEC_ESP and not HMAC_SNOOP_NO_AFEU which is less performant. This is done by adding a priority field in the template. If the field is 0, we use the default priority, otherwise we used the one in the field. Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos

[PATCH v2 3/7] crypto: talitos - making mapping helpers more generic

2016-06-06 Thread Christophe Leroy
to not make it several times. talitos_edesc_alloc() size calculation are fixed to also take into account AEAD specific parts also for SEC1 Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 230 +++ 1 file c

[PATCH v2 2/7] crypto: talitos - move mapping helpers before IPSEC functions

2016-06-06 Thread Christophe Leroy
In order to be able to use the mapping/unmapping helpers for IPSEC it needs to be move upper in the file Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 244 +++ 1 file changed, 122 insertions(+), 122 del

[PATCH v2 7/7] crypto: talitos - templates for AEAD using HMAC_SNOOP_NO_AFEU

2016-06-06 Thread Christophe Leroy
This will allow IPSEC on SEC1 Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 180 +++ 1 file changed, 180 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index dfd3a93..0

[PATCH v2 5/7] crypto: talitos - sg_to_link_tbl() not used anymore, remove it

2016-06-06 Thread Christophe Leroy
Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 4ff03c3..ff8cf39 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/tal

[PATCH v2 1/7] crypto: talitos - using helpers for all talitos_ptr operations

2016-06-06 Thread Christophe Leroy
keeping single lines of 80 chars Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 59 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c

Re: [PATCH 2/6] crypto: talitos - making mapping helpers more generic

2016-06-06 Thread Christophe Leroy
Le 31/05/2016 à 11:46, Herbert Xu a écrit : On Fri, May 27, 2016 at 11:32:36AM +0200, Christophe Leroy wrote: + sg_count = sg_to_link_tbl_offset(src, sg_count, offset, len, +>link_tbl[tbl_off]) + if (sg_count == 1) { + /* O

[PATCH 2/6] crypto: talitos - making mapping helpers more generic

2016-05-27 Thread Christophe Leroy
calculation are fixed to also take into account AEAD specific parts also for SEC1 Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 243 ++- 1 file changed, 94 insertions(+), 149 deletions(-) diff --git a/drivers/

[PATCH 1/6] crypto: talitos - using helpers for all talitos_ptr operations

2016-05-27 Thread Christophe Leroy
keeping single lines of 80 chars Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 59 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c

[PATCH 0/6] crypto: talitos - implementation of AEAD for SEC1

2016-05-27 Thread Christophe Leroy
This set of patches provides the implementation of AEAD for talitos SEC1. Christophe Leroy (6): crypto: talitos - using helpers for all talitos_ptr operations crypto: talitos - making mapping helpers more generic crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU crypto

[PATCH 3/6] crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU

2016-05-27 Thread Christophe Leroy
has CICV out in pointer 6 * HMAC_SNOOP_NO_AFEU has no primary EU context out so we get it from the end of data out Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 205 +++ 1 file changed, 119 insertions(

[PATCH 6/6] crypto: talitos - templates for AEAD using HMAC_SNOOP_NO_AFEU

2016-05-27 Thread Christophe Leroy
This will allow IPSEC on SEC1 Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 180 +++ 1 file changed, 180 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index b554f56..d

AEAD in TALITOS SEC1 versus TALITOS SEC2

2016-04-20 Thread Christophe Leroy
Today, in Talitos driver crypto alg registration is based on predefined templates with a predefined descriptor type and verification against the descriptors supported by the HW. This works well for ALG that require a unique descriptor. But for IPsec this is slightly different: * IPsec can be

[PATCH] crypto: talitos - add new crypto modes

2015-12-01 Thread Christophe Leroy
This patch adds the following algorithms to the talitos driver: * ecb(aes) * ctr(aes) * ecb(des) * cbc(des) * ecb(des3_ede) Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> --- drivers/crypto/talitos.c | 83 drivers/crypto/talitos.

Re: [PATCH 1/4] crypto: talitos: dma_map_sg can handle chained SG

2015-09-23 Thread Christophe Leroy
Le 23/09/2015 13:55, LABBE Corentin a écrit : The talitos driver use two dma_map_sg path according to SG are chained or not. Since dma_map_sg can handle both case, clean the code with all references to sg chained. Thus removing talitos_map_sg, talitos_unmap_sg_chain and sg_count functions.

[PATCH v3] splice: sendfile() at once fails for big files

2015-05-06 Thread Christophe Leroy
-3.6.3.gz Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- v2: no change, only new commit text v3: comment added iaw Jens Axboe suggestion fs/splice.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/splice.c b/fs/splice.c index 476024b..bfe62ae 100644

[PATCH v2] splice: sendfile() at once fails for big files

2015-04-23 Thread Christophe Leroy
-3.6.3.gz Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- v2: no change, only new commit text fs/splice.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/splice.c b/fs/splice.c index 476024b..fe61723 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1161,7

[PATCH v3 13/17] crypto: talitos - adapt interrupts and reset functions to SEC1

2015-04-17 Thread Christophe Leroy
on SEC1. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 227 +++ drivers/crypto/talitos.h | 39 +--- 2 files changed, 199 insertions(+), 67 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto

[PATCH v3 00/17] crypto: talitos - Add support for SEC1

2015-04-17 Thread Christophe Leroy
time, talitos driver shall support both SEC1 and SEC2+ at the same time. Based on cryptodev-2.6 tree Christophe Leroy (17): crypto: talitos - Use zero entry to init descriptors ptrs to zero crypto: talitos - Refactor the sg in/out chain allocation crypto: talitos - talitos_ptr renamed ptr

[PATCH v3 10/17] crypto: talitos - fill in talitos descriptor iaw SEC1 or SEC2+

2015-04-17 Thread Christophe Leroy
talitos descriptor is slightly different for SEC1 and SEC2+, so lets the helper function that fills the descriptor take into account the type of SEC. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 105 ++- 1 file

[PATCH v3 02/17] crypto: talitos - Refactor the sg in/out chain allocation

2015-04-17 Thread Christophe Leroy
This patch refactors the handling of the input and output data that is quite similar in several functions Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 159 --- 1 file changed, 81 insertions(+), 78 deletions

[PATCH v3 07/17] crypto: talitos - enhanced talitos_desc struct for SEC1

2015-04-17 Thread Christophe Leroy
This patch enhances the talitos_desc struct with fields for SEC1. SEC1 has only one header field, and has a 'next_desc' field in addition. This mixed descriptor will continue to fit SEC2, and for SEC1 we will recopy hdr value into hdr1 value in talitos_submit() Signed-off-by: Christophe Leroy

[PATCH v3 03/17] crypto: talitos - talitos_ptr renamed ptr for more lisibility

2015-04-17 Thread Christophe Leroy
Linux CodyingStyle recommends to use short variables for local variables. ptr is just good enough for those 3 lines functions. It helps keep single lines shorter than 80 characters. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 20 ++-- 1

[PATCH v3 05/17] crypto: talitos - remove param 'extent' in map_single_talitos_ptr()

2015-04-17 Thread Christophe Leroy
map_single_talitos_ptr() is always called with extent == 0, so lets remove this unused parameter Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/crypto

[PATCH v3 06/17] crypto: talitos - helper function for ptr len

2015-04-17 Thread Christophe Leroy
This patch adds a helper function for reads and writes of the len param of the talitos descriptor. This will help implement SEC1 later. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 24 +--- 1 file changed, 17 insertions(+), 7

[PATCH v3 04/17] crypto: talitos - Add a helper function to clear j_extent field

2015-04-17 Thread Christophe Leroy
j_extent field is specific to SEC2 so we add a helper function to clear it so that SEC1 can redefine that function as nop Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH v3 04/17] crypto: talitos - Add a helper function to clear j_extent field

2015-04-17 Thread Christophe Leroy
j_extent field is specific to SEC2 so we add a helper function to clear it so that SEC1 can redefine that function as nop Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH v3 12/17] crypto: talitos - base address for Execution Units

2015-04-17 Thread Christophe Leroy
SEC 1.0, 1.2 and 2.x+ have different EU base addresses, so we need to define pointers for each EU in the driver private data structure. The proper address is set by the probe function depending on the SEC type, in order to provide access to the proper address. Signed-off-by: Christophe Leroy

[PATCH v3 01/17] crypto: talitos - Use zero entry to init descriptors ptrs to zero

2015-04-17 Thread Christophe Leroy
Do use zero_entry value to init the descriptors ptrs to zero instead of writing 0 in each field Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers

[PATCH v3 05/17] crypto: talitos - remove param 'extent' in map_single_talitos_ptr()

2015-04-17 Thread Christophe Leroy
map_single_talitos_ptr() is always called with extent == 0, so lets remove this unused parameter Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/crypto

[PATCH v3 06/17] crypto: talitos - helper function for ptr len

2015-04-17 Thread Christophe Leroy
This patch adds a helper function for reads and writes of the len param of the talitos descriptor. This will help implement SEC1 later. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 24 +--- 1 file changed, 17 insertions(+), 7

[PATCH v3 01/17] crypto: talitos - Use zero entry to init descriptors ptrs to zero

2015-04-17 Thread Christophe Leroy
Do use zero_entry value to init the descriptors ptrs to zero instead of writing 0 in each field Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers

[PATCH v3 09/17] crypto: talitos - Add a feature to tag SEC1

2015-04-17 Thread Christophe Leroy
. If both are compiled in, feature field is checked. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 3 +++ drivers/crypto/talitos.h | 17 + 2 files changed, 20 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index

[PATCH v3 08/17] crypto: talitos - add sub-choice in talitos CONFIG for SEC1

2015-04-17 Thread Christophe Leroy
This patch adds a CONFIG option to select SEC1, SEC2+ or both. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/Kconfig | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 800bf41..8a76a01 100644

[PATCH v3 17/17] crypto: talitos - Update DT bindings with SEC1

2015-04-17 Thread Christophe Leroy
This patch updates the documentation by including SEC1 into SEC2/3 doc Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- Documentation/devicetree/bindings/crypto/fsl-sec2.txt | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings

[PATCH v3 16/17] crypto: talitos - Add fsl,sec1.0 compatible

2015-04-17 Thread Christophe Leroy
We add a specific compatible for SEC1, to handle the differences between SEC1 and SEC2+ Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index

[PATCH v3 17/17] crypto: talitos - Update DT bindings with SEC1

2015-04-17 Thread Christophe Leroy
This patch updates the documentation by including SEC1 into SEC2/3 doc Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- Documentation/devicetree/bindings/crypto/fsl-sec2.txt | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings

[PATCH v3 11/17] crypto: talitos - adaptation of talitos_submit() for SEC1

2015-04-17 Thread Christophe Leroy
SEC1 descriptor is a bit different to SEC2+ descriptor. talitos_submit() will have to copy hdr field into hdr1 field and send the descriptor starting at hdr1 up to next_desc. For SEC2, it remains unchanged and next_desc is just ignored. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr

[PATCH v3 10/17] crypto: talitos - fill in talitos descriptor iaw SEC1 or SEC2+

2015-04-17 Thread Christophe Leroy
talitos descriptor is slightly different for SEC1 and SEC2+, so lets the helper function that fills the descriptor take into account the type of SEC. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 105 ++- 1 file

[PATCH v3 14/17] crypto: talitos - implement scatter/gather copy for SEC1

2015-04-17 Thread Christophe Leroy
also adapt the max buffer size which is only 32k on SEC1 while it is 64k on SEC2+ Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 138 ++- drivers/crypto/talitos.h | 3 +- 2 files changed, 103 insertions(+), 38

[PATCH v3 09/17] crypto: talitos - Add a feature to tag SEC1

2015-04-17 Thread Christophe Leroy
. If both are compiled in, feature field is checked. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 3 +++ drivers/crypto/talitos.h | 17 + 2 files changed, 20 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index

[PATCH v3 13/17] crypto: talitos - adapt interrupts and reset functions to SEC1

2015-04-17 Thread Christophe Leroy
on SEC1. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr --- drivers/crypto/talitos.c | 227 +++ drivers/crypto/talitos.h | 39 +--- 2 files changed, 199 insertions(+), 67 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto

  1   2   >