[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zg+gdDZQG1GeKwGn@gondor.apana.org.au>
Date: Fri, 5 Apr 2024 14:55:48 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Alexey Romanov <avromanov@...utedevices.com>
Cc: neil.armstrong@...aro.org, clabbe@...libre.com, davem@...emloft.net,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
conor+dt@...nel.org, khilman@...libre.com, jbrunet@...libre.com,
martin.blumenstingl@...glemail.com, vadim.fedorenko@...ux.dev,
linux-crypto@...r.kernel.org, linux-amlogic@...ts.infradead.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kernel@...utedevices.com
Subject: Re: [PATCH v6 10/23] drivers: crypto: meson: avoid kzalloc in engine
thread
On Tue, Mar 26, 2024 at 06:32:06PM +0300, Alexey Romanov wrote:
>
> /*
> * struct meson_cipher_tfm_ctx - context for a skcipher TFM
> - * @key: pointer to key data
> + * @keyiv: key data
> * @keylen: len of the key
> * @keymode: The keymode(type and size of key) associated with this TFM
> * @mc: pointer to the private data of driver handling this TFM
> * @fallback_tfm: pointer to the fallback TFM
> */
> struct meson_cipher_tfm_ctx {
> - u32 *key;
> - u32 keylen;
> + u8 keyiv[AES_MAX_KEY_SIZE + AES_BLOCK_SIZE] ____cacheline_aligned;
> + u32 keylen ____cacheline_aligned;
This doesn't do anything to guarantee that tfm_ctx is aligned.
You either need to align this by hand, or you could use the
crypto_skcipher_ctx_dma helper if DMA alignment is what you're
actually looking for.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists