Re: [PATCH] crypto: gcm - fix cacheline sharing

From: Iuliana Prodan
Date: Thu May 30 2019 - 09:49:28 EST


On 5/30/2019 4:34 PM, Herbert Xu wrote:
> On Thu, May 30, 2019 at 01:29:41PM +0000, Iuliana Prodan wrote:
>>
>> I've tried coping the IV before the extended descriptor allocation, but
>> is not working and to make it work will need to make more changes in
>> CAAM. We need the original iv, and if we move it before
>> skcipher_edesc_alloc we lose it.
>> The fix exclusively in CAAM drv, to copy iv before DMA map, is more complex.
>
> Why doesn't it work (apart from the fact that this only makes sense
> for CBC and yet you're doing it for everything including CTR)?
>
> Cheers,
>

On the current structure of caamalg, to work, iv needs to be copied
before memcpy(iv, req->iv, ivsize), from skcipher_edesc_alloc function.
For this we need edesc, but this cannot be allocated before knowing how
much memory we need. So, to make it work, we'll need to modify more in CAAM.

Thanks,
Iulia