RE: [PATCH v2] RANDOM: ATH9K RNG delivers zero bits of entropy

2016-08-08 Thread Pan, Miaoqing
Hi Jason, Stephan, Agree with Jason's point, also understand Stephan's concern. The date rate can be roughly estimated by 'cat /dev/random |rngtest -c 1000', the average speed is .294Kibits/s. I will sent the patch to disable ath9k RNG by default. Thanks, Miaoqing -Original Messag

Re: AF_ALG broken?

2016-08-08 Thread Herbert Xu
Russell King - ARM Linux wrote: > Testing that code on 4.8-rc (and 4.7 fwiw) gives: > > socket(PF_ALG, SOCK_SEQPACKET, 0) = 3 > bind(3, {sa_family=AF_ALG, sa_data="hash\0\0\0\0\0\0\0\0\0\0"}, 88) = 0 > accept(3, 0, NULL) = 4 > write(4, "abc", 3) = -

Re: AF_ALG broken?

2016-08-08 Thread David Miller
From: Russell King - ARM Linux Date: Mon, 8 Aug 2016 23:58:51 +0100 > I don't know, but this seems to go completely against Linus' no > userspace regressions, which seems to be an absolute requirement of > all kernel development... Linus flames people for arguing against > that rule! Reading the

Re: AF_ALG broken?

2016-08-08 Thread Russell King - ARM Linux
On Mon, Aug 08, 2016 at 08:30:32PM +0200, Stephan Mueller wrote: > Am Montag, 8. August 2016, 20:18:32 CEST schrieb Stephan Mueller: > > Hi Stephan, > > > Am Montag, 8. August 2016, 17:44:27 CEST schrieb Russell King - ARM Linux: > > > > Hi Russell, > > > > > Hi, > > > > > > When trying to use

[PATCH v2] crypto: powerpc - CRYPT_CRC32C_VPMSUM should depend on ALTIVEC

2016-08-08 Thread Michael Ellerman
The optimised crc32c implementation depends on VMX (aka. Altivec) instructions, so the kernel must be built with Altivec support in order for the crc32c code to build. Fixes: 6dd7a82cc54e ("crypto: powerpc - Add POWER8 optimised crc32c") Acked-by: Anton Blanchard Signed-off-by: Michael Ellerman

Re: [PATCH v2] RANDOM: ATH9K RNG delivers zero bits of entropy

2016-08-08 Thread Jason Cooper
Hi Stephan, On Mon, Aug 08, 2016 at 05:29:30PM +, Jason Cooper wrote: > On Mon, Aug 08, 2016 at 08:41:36AM +0200, Stephan Mueller wrote: ... > > If you think that this patch is a challenge because your driver starts to > > spin, please help and offer another solution. > > Well, I don't buy t

Re: AF_ALG broken?

2016-08-08 Thread Stephan Mueller
Am Montag, 8. August 2016, 20:18:32 CEST schrieb Stephan Mueller: Hi Stephan, > Am Montag, 8. August 2016, 17:44:27 CEST schrieb Russell King - ARM Linux: > > Hi Russell, > > > Hi, > > > > When trying to use the openssl AF_ALG module with 4.8-rc1 with imx > > caam, I get this: > > > > $ OPENS

Re: AF_ALG broken?

2016-08-08 Thread Stephan Mueller
Am Montag, 8. August 2016, 17:44:27 CEST schrieb Russell King - ARM Linux: Hi Russell, > Hi, > > When trying to use the openssl AF_ALG module with 4.8-rc1 with imx > caam, I get this: > > $ OPENSSL_CONF=/shared/crypto/openssl-imx.cnf strace openssl dgst -md5 > socket(PF_ALG, SOCK_SEQPACKET, 0)

Re: AF_ALG broken?

2016-08-08 Thread Russell King - ARM Linux
On Mon, Aug 08, 2016 at 01:47:33PM -0400, Jeffrey Walton wrote: > > When trying to use the openssl AF_ALG module with 4.8-rc1 with imx > > caam, I get this: > > > > $ OPENSSL_CONF=/shared/crypto/openssl-imx.cnf strace openssl dgst -md5 > > > ... > > socket(PF_ALG, SOCK_SEQPACKET, 0) = 3 > >

Re: [PATCH 00/11] Further iMX CAAM updates

2016-08-08 Thread Fabio Estevam
Hi Russell, On Mon, Aug 8, 2016 at 2:04 PM, Russell King - ARM Linux wrote: > This is a re-post (with hopefully bugs fixed from December's review). > Untested, because AF_ALG appears to be broken in 4.8-rc1. Maybe > someone can provide some hints how to test using tcrypt please? > > Here are fur

Re: AF_ALG broken?

2016-08-08 Thread Jeffrey Walton
> When trying to use the openssl AF_ALG module with 4.8-rc1 with imx > caam, I get this: > > $ OPENSSL_CONF=/shared/crypto/openssl-imx.cnf strace openssl dgst -md5 > ... > socket(PF_ALG, SOCK_SEQPACKET, 0) = 3 > close(3)= 0 > socket(PF_ALG, SOCK_SEQPACKET, 0)

Re: [PATCH v2] RANDOM: ATH9K RNG delivers zero bits of entropy

2016-08-08 Thread Jason Cooper
Hi Stephan, Miaoqing Pan, On Mon, Aug 08, 2016 at 08:41:36AM +0200, Stephan Mueller wrote: > Am Montag, 8. August 2016, 02:03:36 CEST schrieb Pan, Miaoqing: > > The entropy was evaluated by crypto expert, the analysis report show the > > ADC with at least 10bits and up to 22 bits of min-entropy f

[PATCH 09/11] crypto: caam: move job descriptor initialisation to ahash_edesc_alloc()

2016-08-08 Thread Russell King
Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 84 +- 1 file changed, 34 insertions(+), 50 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 2c2c15b63059..9c3e74e4088e 100644 --- a/drivers/cry

[PATCH 10/11] crypto: caam: add ahash_edesc_add_src()

2016-08-08 Thread Russell King
Add a helper to map the source scatterlist into the descriptor. Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 137 + 1 file changed, 57 insertions(+), 80 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caa

[PATCH 11/11] crypto: caam: get rid of tasklet

2016-08-08 Thread Russell King
Threaded interrupts can perform the function of the tasklet, and much more safely too - without races when trying to take the tasklet and interrupt down on device removal. With the old code, there is a window where we call tasklet_kill(). If the interrupt handler happens to be running on a differ

[PATCH 08/11] crypto: caam: add ahash_edesc_alloc() for descriptor allocation

2016-08-08 Thread Russell King
Add a helper function to perform the descriptor allocation. Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 60 +++--- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhas

[PATCH 07/11] crypto: caam: check and use dma_map_sg() return code

2016-08-08 Thread Russell King
Strictly, dma_map_sg() may coalesce SG entries, but in practise on iMX hardware, this will never happen. However, dma_map_sg() can fail, and we completely fail to check its return value. So, fix this properly. Arrange the code to map the scatterlist early, so we know how many scatter table entri

[PATCH 03/11] crypto: caam: incorporate job descriptor into struct ahash_edesc

2016-08-08 Thread Russell King
Rather than giving the descriptor as hw_desc[0], give it's real size. All places where we allocate an ahash_edesc incorporate DESC_JOB_IO_LEN bytes of job descriptor. Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 49 -- 1 file changed, 1

[PATCH 05/11] crypto: caam: replace sec4_sg pointer with array

2016-08-08 Thread Russell King
Since the extended descriptor includes the hardware descriptor, and the sec4 scatterlist immediately follows this, we can declare it as a array at the very end of the extended descriptor. This allows us to get rid of an initialiser for every site where we allocate an extended descriptor. Signed-o

[PATCH 04/11] crypto: caam: mark the hardware descriptor as cache line aligned

2016-08-08 Thread Russell King
Mark the hardware descriptor as being cache line aligned; on DMA incoherent architectures, the hardware descriptor should sit in a separate cache line from the CPU accessed data to avoid polluting the caches. Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 2 +- 1 file changed,

[PATCH 02/11] crypto: caam: ensure descriptor buffers are cacheline aligned

2016-08-08 Thread Russell King
Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index 85c8b048bdc1..47ea7b428156 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/driv

[PATCH 06/11] crypto: caam: ensure that we clean up after an error

2016-08-08 Thread Russell King
Ensure that we clean up allocations and DMA mappings after encountering an error rather than just giving up and leaking memory and resources. Signed-off-by: Russell King --- drivers/crypto/caam/caamhash.c | 132 - 1 file changed, 79 insertions(+), 53 delet

[PATCH 01/11] crypto: caam: fix DMA API mapping leak

2016-08-08 Thread Russell King
caamhash contains this weird code: src_nents = sg_count(req->src, req->nbytes); dma_map_sg(jrdev, req->src, src_nents ? : 1, DMA_TO_DEVICE); ... edesc->src_nents = src_nents; sg_count() returns zero when sg_nents_for_len() returns zero or one. This means we don't n

[PATCH 00/11] Further iMX CAAM updates

2016-08-08 Thread Russell King - ARM Linux
This is a re-post (with hopefully bugs fixed from December's review). Untested, because AF_ALG appears to be broken in 4.8-rc1. Maybe someone can provide some hints how to test using tcrypt please? Here are further imx-caam updates that I've had since before the previous merge window. Please rev

AF_ALG broken?

2016-08-08 Thread Russell King - ARM Linux
Hi, When trying to use the openssl AF_ALG module with 4.8-rc1 with imx caam, I get this: $ OPENSSL_CONF=/shared/crypto/openssl-imx.cnf strace openssl dgst -md5 http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedte

Re: [PATCH 0/2] crypto: caam - authenc fixes

2016-08-08 Thread Herbert Xu
On Thu, Aug 04, 2016 at 08:02:45PM +0300, Horia Geantă wrote: > The first patch fixes a few typos in the encrypt shared descriptor > used by echainiv(authenc) algorithms. > > Second patch fixes the case when .setkey is called before .setauthsize, > avoiding creating authenc descriptors with zero a

Re: [PATCH] crypto: sha3 - Add missing ULL suffixes for 64-bit constants

2016-08-08 Thread Herbert Xu
On Wed, Aug 03, 2016 at 07:37:03PM +0200, Geert Uytterhoeven wrote: > On 32-bit (e.g. with m68k-linux-gnu-gcc-4.1): > > crypto/sha3_generic.c:27: warning: integer constant is too large for > ‘long’ type > crypto/sha3_generic.c:28: warning: integer constant is too large for > ‘long’ type

Re: [PATCH] crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading

2016-08-08 Thread Herbert Xu
Michael Ellerman wrote: > > This is actually an arch/powerpc patch, so I'll merge it unless Herbert > objects. It's fine with me. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this lis