From: Herbert Xu <herbert@gondor.apana.org.au>
To: AlanSong-oc <AlanSong-oc@zhaoxin.com>
Cc: davem@davemloft.net, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, CobeChen@zhaoxin.com,
TonyWWang-oc@zhaoxin.com, YunShen@zhaoxin.com,
GeorgeXue@zhaoxin.com, LeoLiu-oc@zhaoxin.com, HansHu@zhaoxin.com
Subject: Re: [PATCH] crypto: padlock-sha - Add support for Zhaoxin processor
Date: Thu, 12 Jun 2025 13:05:45 +0800 [thread overview]
Message-ID: <aEpgKQ1I0VDSfhO0@gondor.apana.org.au> (raw)
In-Reply-To: <20250611101750.6839-1-AlanSong-oc@zhaoxin.com>
On Wed, Jun 11, 2025 at 06:17:50PM +0800, AlanSong-oc wrote:
>
> +static int padlock_sha1_update_zhaoxin(struct shash_desc *desc,
> + const u8 *src, unsigned int len)
> +{
> + struct sha1_state *state = padlock_shash_desc_ctx(desc);
> + int blocks = len / SHA1_BLOCK_SIZE;
> +
> + /* The xsha1 instruction requires a 32-byte buffer for execution for Zhaoxin processors */
> + u8 buf[32 + PADLOCK_ALIGNMENT - 1];
> + u8 *dst = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
The padlock has always had an alignment requirement. We already
deal with this by using PADLOCK_ALIGNMENT. So rather than re-inventing
it here, you should simply change PADLOCK_ALIGNMENT to 32 for Zhaoxin.
You should also fix the comment to state that 32 is for alignment
rather than the size. The Nano already requires an 128-byte buffer
and we cater for that so it can't be the size that's the problem
here.
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-06-12 5:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 10:17 AlanSong-oc
2025-06-12 5:05 ` Herbert Xu [this message]
2025-06-16 12:23 ` AlanSong-oc
2025-06-23 9:24 ` Herbert Xu
2025-06-25 1:51 ` AlanSong-oc
2025-09-25 20:23 ` Salvatore Bonaccorso
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=aEpgKQ1I0VDSfhO0@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=AlanSong-oc@zhaoxin.com \
--cc=CobeChen@zhaoxin.com \
--cc=GeorgeXue@zhaoxin.com \
--cc=HansHu@zhaoxin.com \
--cc=LeoLiu-oc@zhaoxin.com \
--cc=TonyWWang-oc@zhaoxin.com \
--cc=YunShen@zhaoxin.com \
--cc=davem@davemloft.net \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®