Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-22 Thread Stephen Boyd
Quoting Timur Tabi (2018-06-22 08:41:11) > On 6/22/18 10:38 AM, Stanimir Varbanov wrote: > > Before entering into the read function we already hold a mutex which > > serializes data reading so I cannot imagine how below sequence could > > happen. Can you explain how to reproduce this race? > > >

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-22 Thread Timur Tabi
On 6/22/18 12:51 PM, Stephen Boyd wrote: Perhaps it's because you implemented the 'wait' functionality in this driver? Before the patch there wasn't any sort of wait check so we would bail out if there wasn't any data even if the caller requested that we wait for randomness to be available.

[cryptodev:master 9/15] drivers/crypto/inside-secure/safexcel_hash.c:1373:25: sparse: cast truncates bits from constant value (cbbb9d5dc1059ed8 becomes c1059ed8)

2018-06-22 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: 38641b83ebc54635151810eeef00b61da3097952 commit: 9e46eafdf82a67dd069eef27c48898b79379c9f2 [9/15] crypto: inside-secure - sha384 support reproduce: # apt-get install sparse git

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-22 Thread Timur Tabi
On 6/22/18 10:38 AM, Stanimir Varbanov wrote: Before entering into the read function we already hold a mutex which serializes data reading so I cannot imagine how below sequence could happen. Can you explain how to reproduce this race? 1. Core 1 reads status register, shows data is available.

[PATCH 1/2] dt-bindings: fsl-imx-sahara: Add i.MX51 as a supported SoC

2018-06-22 Thread Fabio Estevam
From: Fabio Estevam i.MX51 and i.MX51 share the same sahara IP block version, so add i.MX51 in the list of supported SoCs. Signed-off-by: Fabio Estevam --- Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH 2/2] crypto: sahara - Add i.MX51 entry

2018-06-22 Thread Fabio Estevam
From: Fabio Estevam i.MX51 and i.MX51 share the same sahara IP block version, so add i.MX51 in the compatible list. Signed-off-by: Fabio Estevam --- drivers/crypto/sahara.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/sahara.c

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-22 Thread Timur Tabi
On 06/22/2018 01:03 PM, Timur Tabi wrote: Perhaps it's because you implemented the 'wait' functionality in this driver? Before the patch there wasn't any sort of wait check so we would bail out if there wasn't any data even if the caller requested that we wait for randomness to be available.

[cryptodev:master 5/15] drivers/crypto/inside-secure/safexcel_hash.c:1299:25: sparse: cast truncates bits from constant value (6a09e667f3bcc908 becomes f3bcc908)

2018-06-22 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: 38641b83ebc54635151810eeef00b61da3097952 commit: b460edb6230ac2877b0d176b9122736fed6f3c6e [5/15] crypto: inside-secure - sha512 support reproduce: # apt-get install sparse git

Re: [PATCH 3/5] crypto: testmgr - Improve compression/decompression test

2018-06-22 Thread Eric Biggers
Hi Jan, On Fri, Jun 22, 2018 at 04:37:20PM +0200, Jan Glauber wrote: > While commit 336073840a87 ("crypto: testmgr - Allow different compression > results") > allowed to test non-generic compression algorithms there are some corner > cases that would not be detected in test_comp(). > > For

Re: [PATCH 4/5] crypto: testmgr - Add test vectors for LZS compression

2018-06-22 Thread Eric Biggers
Hi Jan, On Fri, Jun 22, 2018 at 04:37:21PM +0200, Jan Glauber wrote: > The test vectors were generated using the ThunderX ZIP coprocessor. > > Signed-off-by: Jan Glauber > --- > crypto/testmgr.c | 9 ++ > crypto/testmgr.h | 77 > 2 files

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-22 Thread Stanimir Varbanov
Hi, On 06/21/2018 06:17 PM, Timur Tabi wrote: > The hwrng.read callback includes a boolean parameter called 'wait' > which indicates whether the function should block and wait for > more data. > > When 'wait' is true, the driver spins on the DATA_AVAIL bit or until > a reasonable timeout. The

[PATCH v2 2/2] crypto: sahara - Add i.MX51 entry

2018-06-22 Thread Fabio Estevam
From: Fabio Estevam i.MX51 and i.MX53 share the same sahara IP block version, so add i.MX51 in the compatible list. Signed-off-by: Fabio Estevam --- Changes since v1: - Fix typo in commit log "i.MX51 and i.MX53" drivers/crypto/sahara.c | 5 - 1 file changed, 4 insertions(+), 1

[PATCH v2 1/2] dt-bindings: fsl-imx-sahara: Add i.MX51 as a supported SoC

2018-06-22 Thread Fabio Estevam
From: Fabio Estevam i.MX51 and i.MX53 share the same sahara IP block version, so add i.MX51 in the list of supported SoCs. Signed-off-by: Fabio Estevam --- Changes since v1: - Fix typo in commit log "i.MX51 and i.MX53" Documentation/devicetree/bindings/crypto/fsl-imx-sahara.txt | 5 +++-- 1

[PATCH 0/5] Improve crypto compression tests

2018-06-22 Thread Jan Glauber
Hi Herbert, I've been trying to address your comment from: https://marc.info/?l=linux-crypto-vger=152410933702305=2 with patches 1-4. I've only found deflate and LZS to have a non-generic implementation, but LZS does not have a generic one so for now deflate seems to be the only algorithm that

[PATCH 2/5] crypto: thunderx_zip - Add driver names and module aliases

2018-06-22 Thread Jan Glauber
Add missing cra_driver_name's and module aliases for deflate and lzs. Signed-off-by: Jan Glauber --- drivers/crypto/cavium/zip/zip_main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/cavium/zip/zip_main.c b/drivers/crypto/cavium/zip/zip_main.c

[PATCH 3/5] crypto: testmgr - Improve compression/decompression test

2018-06-22 Thread Jan Glauber
While commit 336073840a87 ("crypto: testmgr - Allow different compression results") allowed to test non-generic compression algorithms there are some corner cases that would not be detected in test_comp(). For example if input -> compression -> decompression would all yield the same bytes the

[PATCH 4/5] crypto: testmgr - Add test vectors for LZS compression

2018-06-22 Thread Jan Glauber
The test vectors were generated using the ThunderX ZIP coprocessor. Signed-off-by: Jan Glauber --- crypto/testmgr.c | 9 ++ crypto/testmgr.h | 77 2 files changed, 86 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c index

[PATCH 5/5] crypto: thunderx_zip - Make functions static

2018-06-22 Thread Jan Glauber
Make functions static where possible, found by sparse. Signed-off-by: Jan Glauber --- drivers/crypto/cavium/zip/zip_crypto.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/cavium/zip/zip_crypto.c b/drivers/crypto/cavium/zip/zip_crypto.c

[PATCH 1/5] crypto: deflate - Rename to generic

2018-06-22 Thread Jan Glauber
Rename deflate -> deflate_generic and add the default priority of 100. Signed-off-by: Jan Glauber --- crypto/Makefile | 2 +- crypto/{deflate.c => deflate_generic.c} | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) rename crypto/{deflate.c => deflate_generic.c}

Re: [PATCH 1/2] hwrng: msm: add a spinlock and support for blocking reads

2018-06-22 Thread Timur Tabi
On 6/22/18 12:36 AM, Stephen Boyd wrote: Quoting Timur Tabi (2018-06-21 08:17:55) @@ -96,11 +110,39 @@ static int msm_rng_read(struct hwrng *hwrng, void *data, size_t max, bool wait) /* read random data from hardware */ do { - val = readl_relaxed(rng->base +

Re: [PATCH] crypto: atmel-ecc - fix to allow multi segment scatterlists

2018-06-22 Thread Herbert Xu
On Wed, Jun 13, 2018 at 04:29:58PM +0300, Tudor Ambarus wrote: > Remove the limitation of single element scatterlists. ECDH with > multi-element scatterlists is needed by TPM. > > Similar to 'commit 95ec01ba1ef0 ("crypto: ecdh - fix to allow multi > segment scatterlists")'. > > Signed-off-by:

Re: [PATCH 00/10] crypto: inside-secure - sha512/384 support

2018-06-22 Thread Herbert Xu
On Tue, May 29, 2018 at 02:13:42PM +0200, Antoine Tenart wrote: > Hello Herbert, > > This series adds support for the SHA512 and SHA384 algorithms in the > Inside Secure SafeXcel driver. Variants of those two algorithms are also > added as well (hmac, and AEAD). > > Before doing so a few patches

Re: [PATCH] crypto: cavium: make structure algs static

2018-06-22 Thread Herbert Xu
On Fri, Jun 01, 2018 at 02:12:27PM +0100, Colin King wrote: > From: Colin Ian King > > The structure algs is local to the source and does not need to be in > global scope, so make it static. > > Cleans up sparse warning: > drivers/crypto/cavium/cpt/cptvf_algs.c:354:19: warning: symbol 'algs' >

Re: [PATCH] crypto: atmel-ecc - remove overly verbose dev_info

2018-06-22 Thread Herbert Xu
On Wed, Jun 13, 2018 at 04:29:59PM +0300, Tudor Ambarus wrote: > Remove it because when using a slow console, it can affect > the speed of crypto operations. > > Similar to 'commit 730f23b66095 ("crypto: vmx - Remove overly > verbose printk from AES XTS init")'. > > Signed-off-by: Tudor Ambarus