From: Herbert Xu <herbert@gondor.apana.org.au>
To: T Pratham <t-pratham@ti.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Manorit Chawdhry <m-chawdhry@ti.com>,
Kamlesh Gurudasani <kamlesh@ti.com>,
Shiva Tripathi <s-tripathi1@ti.com>,
Kavitha Malarvizhi <k-malarvizhi@ti.com>,
Vishal Mahaveer <vishalm@ti.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/4] crypto: ti - Add support for AES-CTR in DTHEv2 driver
Date: Fri, 21 Nov 2025 11:11:03 +0800 [thread overview]
Message-ID: <aR_YR_nF4sjUlgN6@gondor.apana.org.au> (raw)
In-Reply-To: <20251111112137.976121-3-t-pratham@ti.com>
On Tue, Nov 11, 2025 at 04:38:31PM +0530, T Pratham wrote:
>
> @@ -270,12 +326,17 @@ static int dthe_aes_run(struct crypto_engine *engine, void *areq)
> struct scatterlist *src = req->src;
> struct scatterlist *dst = req->dst;
>
> + struct scatterlist src_pad[2], dst_pad[2];
> +
> int src_nents = sg_nents_for_len(src, len);
> - int dst_nents;
> + int dst_nents = sg_nents_for_len(dst, len);
>
> int src_mapped_nents;
> int dst_mapped_nents;
>
> + u8 pad_buf[AES_BLOCK_SIZE] = {0};
You can't put stack memory into an SG list since the ability to
DMA to the stack is not guaranteed.
I suggest that you place the buffer into the request object instead.
The request object is designed to allow DMA and you can allocate as
much memory as you like by setting reqsize.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2025-11-21 3:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 11:08 [PATCH v6 0/4] Add support for more AES modes in TI DTHEv2 T Pratham
2025-11-11 11:08 ` [PATCH v6 1/4] crypto: ti - Add support for AES-XTS in DTHEv2 driver T Pratham
2025-11-11 11:40 ` T Pratham
2025-11-11 11:08 ` [PATCH v6 2/4] crypto: ti - Add support for AES-CTR " T Pratham
2025-11-21 3:11 ` Herbert Xu [this message]
2025-11-11 11:08 ` [PATCH v6 3/4] crypto: ti - Add support for AES-GCM " T Pratham
2025-11-14 6:47 ` kernel test robot
2025-11-14 9:04 ` T Pratham
2025-11-14 7:52 ` kernel test robot
2025-11-14 9:36 ` kernel test robot
2025-11-11 11:08 ` [PATCH v6 4/4] crypto: ti - Add support for AES-CCM " T Pratham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aR_YR_nF4sjUlgN6@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=k-malarvizhi@ti.com \
--cc=kamlesh@ti.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m-chawdhry@ti.com \
--cc=s-tripathi1@ti.com \
--cc=t-pratham@ti.com \
--cc=vishalm@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®