Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Nicolas Pitre
On Tue, 1 Jul 2014, Will Deacon wrote: > Hi Mans, > > On Tue, Jul 01, 2014 at 06:24:43PM +0100, Måns Rullgård wrote: > > Russell King - ARM Linux writes: > > > As you point out, "bx lr" /may/ be treated specially (I've actually been > > > > Most, if not all, Cortex-A cores do this according the

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Robert Jarzmik
Russell King writes: > ARMv6 and greater introduced a new instruction ("bx") which can be used > to return from function calls. Recent CPUs perform better when the > "bx lr" instruction is used rather than the "mov pc, lr" instruction, > and this sequence is strongly recommended to be used by th

[PATCH v2 1/3] ima: use ahash API for file hash calculation

2014-07-01 Thread Dmitry Kasatkin
Async hash API allows to use HW acceleration for hash calculation. It may give significant performance gain or/and reduce power consumption, which might be very beneficial for battery powered devices. This patch introduces hash calculation using ahash API. ahash performance depends on data size a

[PATCH v2 2/3] ima: introduce multi-page collect buffers

2014-07-01 Thread Dmitry Kasatkin
Use of multiple-page collect buffers reduces: 1) the number of block IO requests 2) the number of asynchronous hash update requests Second is important for HW accelerated hashing, because significant amount of time is spent for preparation of hash update operation, which includes configuring accel

[PATCH v2 3/3] ima: provide double buffering for hash calculation

2014-07-01 Thread Dmitry Kasatkin
Asynchronous hash API allows initiate hash calculation and perform other tasks while hash is calculated. This patch introduces usage of double buffering for simultaneous hashing and reading of the next chunk of data from the storage. Signed-off-by: Dmitry Kasatkin --- security/integrity/ima/ima

[PATCH v2 0/3] ima: use asynchronous hash API for hash calculation

2014-07-01 Thread Dmitry Kasatkin
Depending on the IMA policy, it might require to measure huge amount of files. It may be very important to speedup hash calculation or to reduce (bettery) energy required to do it. Currently IMA uses synchronous hash API (shash) which is CPU based. CPU based hash calculation is very CPU intensive a

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Måns Rullgård
Will Deacon writes: > Hi Mans, > > On Tue, Jul 01, 2014 at 06:24:43PM +0100, Måns Rullgård wrote: >> Russell King - ARM Linux writes: >> > As you point out, "bx lr" /may/ be treated specially (I've actually been >> >> Most, if not all, Cortex-A cores do this according the public TRMs. >> They a

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Stephen Warren
On 07/01/2014 10:19 AM, Russell King wrote: > ARMv6 and greater introduced a new instruction ("bx") which can be used > to return from function calls. Recent CPUs perform better when the > "bx lr" instruction is used rather than the "mov pc, lr" instruction, > and this sequence is strongly recomme

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Will Deacon
Hi Mans, On Tue, Jul 01, 2014 at 06:24:43PM +0100, Måns Rullgård wrote: > Russell King - ARM Linux writes: > > As you point out, "bx lr" /may/ be treated specially (I've actually been > > Most, if not all, Cortex-A cores do this according the public TRMs. > They also do the same thing for "mov p

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Måns Rullgård
Russell King - ARM Linux writes: > On Tue, Jul 01, 2014 at 05:42:42PM +0100, Måns Rullgård wrote: >> Russell King writes: >> >> > ARMv6 and greater introduced a new instruction ("bx") which can be used >> > to return from function calls. Recent CPUs perform better when the >> > "bx lr" instruc

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Russell King - ARM Linux
On Tue, Jul 01, 2014 at 05:42:42PM +0100, Måns Rullgård wrote: > Russell King writes: > > > ARMv6 and greater introduced a new instruction ("bx") which can be used > > to return from function calls. Recent CPUs perform better when the > > "bx lr" instruction is used rather than the "mov pc, lr"

Re: [PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part1)

2014-07-01 Thread Måns Rullgård
Russell King writes: > ARMv6 and greater introduced a new instruction ("bx") which can be used > to return from function calls. Recent CPUs perform better when the > "bx lr" instruction is used rather than the "mov pc, lr" instruction, > and this sequence is strongly recommended to be used by th

[PATCH] ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ (part2)

2014-07-01 Thread Russell King
--- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S @@ -55,7 +55,7 @@ * cpu_arm926_proc_init() */ ENTRY(cpu_arm926_proc_init) - mov pc, lr + ret lr /* * cpu_arm926_proc_fin() @@ -65,7 +65,7 @@ ENTRY(cpu_arm926_proc_fin) bic r0, r0, #0x1000

Re: [PATCH 1/2] [v3] crypto: sha1/ARM: make use of common SHA-1 structures

2014-07-01 Thread Phil Sutter
Hi, On Mon, Jun 30, 2014 at 07:38:46PM +0300, Jussi Kivilinna wrote: > Common SHA-1 structures are defined in for code sharing. > > This patch changes SHA-1/ARM glue code to use these structures. I find it worth noting that this patch also fixes mv_cesa if sha1-arm is also enabled. This is beca

[PATCH 0/4] DRBG: Fixes for code review comments

2014-07-01 Thread Stephan Mueller
Hi, the following fixes cover comments from code reviewers. The patch set is an addition to the patch set offered several days ago [1]. [1] https://lkml.org/lkml/2014/6/28/497 Stephan Mueller (4): DRBG: Select correct DRBG core for stdrng DRBG: Mix a time stamp into DRBG state DRBG: fix me

[PATCH 1/4] DRBG: Select correct DRBG core for stdrng

2014-07-01 Thread Stephan Mueller
When the DRBG is initialized, the core is looked up using the DRBG name. The name that can be used for the lookup is registered in cra_driver_name. The cra_name value contains stdrng. Thus, the lookup code must use crypto_tfm_alg_driver_name to obtain the precise DRBG name and select the correct D

[PATCH 2/4] DRBG: Mix a time stamp into DRBG state

2014-07-01 Thread Stephan Mueller
The current locking approach of the DRBG tries to keep the protected code paths very minimal. It is therefore possible that two threads query one DRBG instance at the same time. When thread A requests random numbers, a shadow copy of the DRBG state is created upon which the request for A is process

[PATCH 3/4] DRBG: fix memory corruption for AES192

2014-07-01 Thread Stephan Mueller
For the CTR DRBG, the drbg_state->scratchpad temp buffer (i.e. the memory location immediately before the drbg_state->tfm variable is the buffer that the BCC function operates on. BCC operates blockwise. Making the temp buffer drbg_statelen(drbg) in size is sufficient when the DRBG state length is

[PATCH 4/4] DRBG: HMAC-SHA1 DRBG has crypto strength of 128 bits

2014-07-01 Thread Stephan Mueller
The patch corrects the security strength of the HMAC-SHA1 DRBG to 128 bits. This strength defines the size of the seed required for the DRBG. Thus, the patch lowers the seeding requirement from 256 bits to 128 bits for HMAC-SHA1. Signed-off-by: Stephan Mueller --- crypto/drbg.c | 2 +- 1 file ch

Testing the PRNG driver of the Allwinner Security System A20

2014-07-01 Thread Corentin LABBE
Hello I am writing the PRNG driver for the Allwinner Security System SoC A20. I didn't know how to test it, so I have found that char/hw_random/exynos-rng.c exposes a PRNG via the hwrng interfaces. So I have written a HWRNG driver that use the SS PRNG via the crypto API (crypto_alloc_rng/crypto

[PATCH] crypto: caam - Enabling multiple caam debug support for C29x platform

2014-07-01 Thread Nitesh Narayan Lal
In the current setup debug file system enables us to debug the operational details for only one CAAM. This patch adds the support for debugging multiple CAAM's. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Vakul Garg --- drivers/crypto/caam/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH] crypto: dts - Addition of missing SEC compatibile property in c29x device tree

2014-07-01 Thread Nitesh Narayan Lal
The driver is compatible with SEC version 4.0, which was missing from device tree resulting that the caam driver doesn't gets probed. Since SEC is backward compatible with older versions, so this patch adds those missing versions in c29x device tree. Signed-off-by: Nitesh Narayan Lal Signed-off-b