Re: Question about padata's callback cpu

2019-06-03 Thread Steffen Klassert
Hi Daniel, On Tue, May 28, 2019 at 07:37:07PM -0400, Daniel Jordan wrote: > Hi Steffen, > > I'm working on some padata patches and stumbled across this thread about the > purpose of the callback CPU in padata_do_parallel. > > https://lore.kernel.org/lkml/20100402112326.ga19...@secunet.com/

Re: [PATCH 0/4] zstd: reduce stack usage

2019-06-03 Thread Andrew Morton
On Mon, 3 Jun 2019 14:32:02 +0530 Maninder Singh wrote: > This patch set reduces stack usage for zstd code, because target like ARM has > limited 8KB kernel stack, which is getting overflowed due to hight stack usage > of zstd code with call flow like: That's rather bad behaviour. I assume th

Re: [PATCH 1/4] zstd: pass pointer rathen than structure to functions

2019-06-03 Thread Andrew Morton
On Mon, 3 Jun 2019 14:32:03 +0530 Maninder Singh wrote: > currently params structure is passed in all functions, which increases > stack usage in all the function and lead to stack overflow on target like > ARM with kernel stack size of 8 KB so better to pass pointer. > > Checked for ARM: > >

Re: [PATCH 3/4] zstd: move params structure to global variable to reduce stack usage

2019-06-03 Thread Andrew Morton
On Mon, 3 Jun 2019 14:32:05 +0530 Maninder Singh wrote: > > Subject: [PATCH 3/4] zstd: move params structure to global variable to reduce > stack usage If this affected lib/zstd/ I'd be alarmed. But it's a client of lib/zstd that is choosing to have a single kernel-wide copy. I'll rewrite

Re: [PATCH] crypto: ghash - fix unaligned memory access in ghash_setkey()

2019-06-03 Thread Eric Biggers
On Mon, Jun 03, 2019 at 09:27:24AM +0200, Christophe Leroy wrote: > > > Le 30/05/2019 à 19:50, Eric Biggers a écrit : > > From: Eric Biggers > > > > Changing ghash_mod_init() to be subsys_initcall made it start running > > before the alignment fault handler has been installed on ARM. In kernel

Re: [RFC PATCH 1/2] crypto: Allow working with key references

2019-06-03 Thread Herbert Xu
On Mon, Jun 03, 2019 at 09:59:53AM +0200, Harald Freudenberger wrote: > > The "p" in paes is because we call it "protected key aes". I think you are > not limited > to the "p". What Herbert tries to point out is that you may define your own > cipher with an unique name and there you can handle you

Re: [v2 PATCH] crypto: caam - fix DKP detection logic

2019-06-03 Thread Horia Geanta
On 6/3/2019 11:43 AM, Greg Kroah-Hartman wrote: > On Mon, Jun 03, 2019 at 08:10:15AM +, Horia Geanta wrote: >> On 6/3/2019 10:52 AM, Greg Kroah-Hartman wrote: >>> On Thu, May 30, 2019 at 11:36:25AM +, Horia Geanta wrote: On 5/6/2019 11:06 AM, Horia Geanta wrote: > On 5/6/2019 9:40

[PATCH 3/4] zstd: move params structure to global variable to reduce stack usage

2019-06-03 Thread Maninder Singh
As params structure remains same for lifetime, just initialise it at init time and make it global variable. Signed-off-by: Maninder Singh Signed-off-by: Vaneet Narang --- crypto/zstd.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crypto/zstd.c b/crypto/zstd.c ind

[PATCH 0/4] zstd: reduce stack usage

2019-06-03 Thread Maninder Singh
This patch set reduces stack usage for zstd code, because target like ARM has limited 8KB kernel stack, which is getting overflowed due to hight stack usage of zstd code with call flow like: (FSE_compress_usingCTable) from (HUF_compressWeights_wksp+0x140/0x200) (HUF_compressWeights_wksp)

[PATCH 4/4] zstd: change structure variable from int to char

2019-06-03 Thread Maninder Singh
Elements of ZSTD_frameParameters structure are used as flag, so just declare them as char. ZSTD_frameParameters structure is used by ZSTD_parameters. Before: == sizeof(ZSTD_parameters) $1 = 40 After: = sizeof(ZSTD_parameters) $1 = 32 Signed-off-by: Maninder Singh Signed-off-by: Vaneet N

[PATCH 1/4] zstd: pass pointer rathen than structure to functions

2019-06-03 Thread Maninder Singh
currently params structure is passed in all functions, which increases stack usage in all the function and lead to stack overflow on target like ARM with kernel stack size of 8 KB so better to pass pointer. Checked for ARM: Original Patched Call FLow

[PATCH 2/4] zstd: use U16 data type for rankPos

2019-06-03 Thread Maninder Singh
rankPos structure variables value can not be more than 512. So it can easily be declared as U16 rather than U32. It will reduce stack usage of HUF_sort from 256 bytes to 128 bytes original: e92ddbf0push{r4, r5, r6, r7, r8, r9, fp, ip, lr, pc} e24cb004sub fp, ip, #4 e24ddc0

Re: [v2 PATCH] crypto: caam - fix DKP detection logic

2019-06-03 Thread Greg Kroah-Hartman
On Mon, Jun 03, 2019 at 08:10:15AM +, Horia Geanta wrote: > On 6/3/2019 10:52 AM, Greg Kroah-Hartman wrote: > > On Thu, May 30, 2019 at 11:36:25AM +, Horia Geanta wrote: > >> On 5/6/2019 11:06 AM, Horia Geanta wrote: > >>> On 5/6/2019 9:40 AM, Herbert Xu wrote: > On Fri, May 03, 2019 a

Re: [v2 PATCH] crypto: caam - fix DKP detection logic

2019-06-03 Thread Horia Geanta
On 6/3/2019 10:52 AM, Greg Kroah-Hartman wrote: > On Thu, May 30, 2019 at 11:36:25AM +, Horia Geanta wrote: >> On 5/6/2019 11:06 AM, Horia Geanta wrote: >>> On 5/6/2019 9:40 AM, Herbert Xu wrote: On Fri, May 03, 2019 at 03:05:48PM +0300, Horia Geantă wrote: > The detection whether DKP

Re: [RFC PATCH 1/2] crypto: Allow working with key references

2019-06-03 Thread Harald Freudenberger
On 30.05.19 09:23, Richard Weinberger wrote: > - Ursprüngliche Mail - >> Von: "Herbert Xu" >> An: "richard" >> CC: "Linux Crypto Mailing List" , >> linux-arm-ker...@lists.infradead.org, "linux-kernel" >> , linux-...@nxp.com, feste...@gmail.com, >> "kernel" , "Sascha Hauer" >> , shawn...

Re: [v2 PATCH] crypto: caam - fix DKP detection logic

2019-06-03 Thread Greg Kroah-Hartman
On Thu, May 30, 2019 at 11:36:25AM +, Horia Geanta wrote: > On 5/6/2019 11:06 AM, Horia Geanta wrote: > > On 5/6/2019 9:40 AM, Herbert Xu wrote: > >> On Fri, May 03, 2019 at 03:05:48PM +0300, Horia Geantă wrote: > >>> The detection whether DKP (Derived Key Protocol) is used relies on > >>> the

Re: [PATCH] crypto: ghash - fix unaligned memory access in ghash_setkey()

2019-06-03 Thread Christophe Leroy
Le 30/05/2019 à 19:50, Eric Biggers a écrit : From: Eric Biggers Changing ghash_mod_init() to be subsys_initcall made it start running before the alignment fault handler has been installed on ARM. In kernel builds where the keys in the ghash test vectors happened to be misaligned in the ker

RE: Conding style question regarding configuration

2019-06-03 Thread Pascal Van Leeuwen
> > Well, I got a complaint from someone that my driver updates for adding > PCIE > > support wouldn't compile properly on a platform without a PCI(E) > subsystem. > > So I figure I do have to config out the references to PCI specific > function > > calls to fix that. > > Do you have a link to yo

Re: Conding style question regarding configuration

2019-06-03 Thread Christophe Leroy
Le 30/05/2019 à 12:16, Pascal Van Leeuwen a écrit : Yes. Code and data with static linkage will just be optimized away by the compiler if the CONFIG_xx option is not enabled, so all you need to guard are the actual statements, function calls etc. Ok, makes sense. Then I'll just config out th