From: Depei Yang <yangdepei@hygon.cn>
To: <linux-crypto@vger.kernel.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Gary R Hook <gary.hook@amd.com>, <linux-kernel@vger.kernel.org>,
Depei Yang <yangdepei@hygon.cn>, Shan Chen <chenshan@hygon.cn>,
Yongwei Xu <xuyongwei@hygon.cn>,
Xiaochen Shen <shenxiaochen@hygon.cn>, <stable@vger.kernel.org>
Subject: [PATCH 01/11] crypto: ccp - fix LSB region mask calculation
Date: Wed, 25 Nov 2026 15:45:59 +0800 [thread overview]
Message-ID: <4ee059fdd4a5f374b94625c25ea4abd2b2c10237.1795588986.git.yangdepei@hygon.cn> (raw)
In-Reply-To: <cover.1795588986.git.yangdepei@hygon.cn>
ccp_find_lsb_regions() tests the queue bit of status before shifting the
register by the region width, so region 0 is examined for region 1 and
the last region is never checked. Shift the status before the loop so
that each iteration tests the region it records.
Fixes: 4b394a232df7 ("crypto: ccp - Let a v5 CCP provide the same function as v3")
Cc: stable@vger.kernel.org
Reviewed-by: Shan Chen <chenshan@hygon.cn>
Tested-by: Yongwei Xu <xuyongwei@hygon.cn>
Signed-off-by: Depei Yang <yangdepei@hygon.cn>
---
drivers/crypto/ccp/ccp-dev-v5.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index dacde9614e8a..4a546224af79 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -593,6 +593,7 @@ static int ccp_find_lsb_regions(struct ccp_cmd_queue *cmd_q, u64 status)
/* Build a bit mask to know which LSBs this queue has access to.
* Don't bother with segment 0 as it has special privileges.
*/
+ status >>= LSB_REGION_WIDTH;
for (j = 1; j < MAX_LSB_CNT; j++) {
if (status & q_mask)
bitmap_set(cmd_q->lsbmask, j, 1);
--
2.34.1
next prev parent reply other threads:[~2026-11-25 7:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 7:45 [PATCH 00/11] crypto: ccp - add Hygon SM3/SM4 support Depei Yang
2026-11-25 7:45 ` Depei Yang [this message]
2026-11-25 7:46 ` [PATCH 02/11] crypto: ccp - acknowledge queue interrupt before waking waiter Depei Yang
2026-11-25 7:46 ` [PATCH 03/11] crypto: ccp - add engine capability and version information Depei Yang
2026-11-25 7:46 ` [PATCH 04/11] crypto: ccp - register algorithms only for supported engines Depei Yang
2026-11-25 7:46 ` [PATCH 05/11] crypto: ccp - split v5 command submission from queue run Depei Yang
2026-11-25 7:46 ` [PATCH 06/11] crypto: ccp - add SM3/SM4 command definitions Depei Yang
2026-11-25 7:46 ` [PATCH 07/11] crypto: ccp - add Hygon CCP device IDs and vdata Depei Yang
2026-11-25 7:46 ` [PATCH 08/11] crypto: ccp - handle only supported interrupts in v5 irq bh Depei Yang
2026-11-25 7:46 ` [PATCH 09/11] crypto: ccp - detect the Hygon CCP engines from the version register Depei Yang
2026-11-25 7:46 ` [PATCH 10/11] crypto: ccp - add SM4 engine and skcipher algorithms Depei Yang
2026-11-25 7:46 ` [PATCH 11/11] crypto: ccp - add SM3 engine and ahash algorithms Depei Yang
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=4ee059fdd4a5f374b94625c25ea4abd2b2c10237.1795588986.git.yangdepei@hygon.cn \
--to=yangdepei@hygon.cn \
--cc=chenshan@hygon.cn \
--cc=davem@davemloft.net \
--cc=gary.hook@amd.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shenxiaochen@hygon.cn \
--cc=stable@vger.kernel.org \
--cc=thomas.lendacky@amd.com \
--cc=xuyongwei@hygon.cn \
/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®