Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-24 Thread Herbert Xu
On Thu, Sep 24, 2020 at 12:51:11PM +, Van Leeuwen, Pascal wrote: > > But you still have 2 potential gaps (from buffer 1 to buffer 2 and from > buffer 2 to > the other items in the struct) that are larger then they may need to be. So put some of the rest of your struct in the middle, up to 128

RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-24 Thread Van Leeuwen, Pascal
> -Original Message- > From: Herbert Xu > Sent: Thursday, September 24, 2020 2:36 PM > To: Van Leeuwen, Pascal > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net; Ard Biesheuvel > Subject: Re: [PATCH] crypto: inside-secure -

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-24 Thread Herbert Xu
On Thu, Sep 24, 2020 at 08:08:12AM +, Van Leeuwen, Pascal wrote: > > The fact that kmalloc uses it does _not_ rule out the fact that it wastes > memory ... > And as long as you use kmalloc for fairly large data structures, it shouldn't > matter much. > But here I need a couple of fairly small

RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-24 Thread Van Leeuwen, Pascal
> -Original Message- > From: Herbert Xu > Sent: Thursday, September 24, 2020 5:12 AM > To: Van Leeuwen, Pascal > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net; Ard Biesheuvel > Subject: Re: [PATCH] crypto: inside-secure -

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-23 Thread Herbert Xu
On Fri, Sep 18, 2020 at 08:21:44AM +, Van Leeuwen, Pascal wrote: > > > Can this alignment exceed ARCH_DMA_MINALIGN? If not then the > > macro CRYPTO_MINALIGN should cover it. > > I don't know. I'm not familiar with that macro and I have not been able to > dig up any > clear description on what

RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-18 Thread Van Leeuwen, Pascal
> -Original Message- > From: Herbert Xu > Sent: Friday, September 18, 2020 10:01 AM > To: Van Leeuwen, Pascal > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net; Ard Biesheuvel > Subject: Re: [PATCH] crypto: inside-secure - Fix co

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-18 Thread Herbert Xu
On Fri, Sep 18, 2020 at 07:42:35AM +, Van Leeuwen, Pascal wrote: > > Actually, that is what we did as a _quick hack_ initially, but: > > First of all, it's not only about the L1 cacheline size. It's about the worst > case cache > line size in the path all the way from the CPU to the actual me

RE: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-18 Thread Van Leeuwen, Pascal
> -Original Message- > From: Herbert Xu > Sent: Friday, September 18, 2020 8:58 AM > To: Van Leeuwen, Pascal > Cc: linux-crypto@vger.kernel.org; antoine.ten...@bootlin.com; > da...@davemloft.net > Subject: Re: [PATCH] crypto: inside-secure - Fix corruption on

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-17 Thread Herbert Xu
On Mon, Sep 07, 2020 at 10:19:44AM +0200, Pascal van Leeuwen wrote: > > @@ -921,9 +943,20 @@ static int safexcel_ahash_cra_init(struct crypto_tfm > *tfm) > ctx->base.send = safexcel_ahash_send; > ctx->base.handle_result = safexcel_handle_result; > ctx->fb_do_setkey = false; > +