Thread (57 messages) 57 messages, 5 authors, 2023-10-24

Re: [PATCH v2 05/19] riscv: add ISA extension parsing for vector crypto extensions

From: Clément Léger <hidden>
Date: 2023-10-23 07:14:53
Also in: linux-doc, linux-riscv, lkml


On 20/10/2023 04:43, Jerry Shih wrote:
On Oct 19, 2023, at 17:35, Clément Léger [off-list ref] wrote:
quoted
On 18/10/2023 19:26, Evan Green wrote:
quoted
On Wed, Oct 18, 2023 at 5:53 AM Clément Léger [off-list ref] wrote:
quoted
On 18/10/2023 03:45, Jerry Shih wrote:
quoted
The `Zvkb` is the subset of `Zvbb`[1]. So, the `Zvkb` should be bundled with `Zvbb`.
Hi Jerry,

Thanks for catching this, I think some other extensions will fall in
this category as well then (Zvknha/Zvknhb). I will verify that.
The bundling mechanism works well when an extension is a pure lasso
around other extensions. We'd have to tweak that code if we wanted to
support cases like this, where the extension is a superset of others,
but also contains loose change not present anywhere else (and
therefore also needs to stand as a separate bit).
For Zvbb and Zvknhb, I used the following code:

static const unsigned int riscv_zvbb_bundled_exts[] = {
	RISCV_ISA_EXT_ZVKB,
	RISCV_ISA_EXT_ZVBB
};

static const unsigned int riscv_zvknhb_bundled_exts[] = {
	RISCV_ISA_EXT_ZVKNHA,
	RISCV_ISA_EXT_ZVKNHB
};

Which correctly results in both extension (superset + base set) being
enabled when only one is set. Is there something that I'm missing ?
We should not bundle zvknha and zvknhb together. They are exclusive.
Yes, but for instance, what happens if the user query the zvknha (if it
only needs SHA256) but zvknhb is present. If we don't declare zvknha,
then it will fail but the support would actually be present due to
zvknhb being there.

Clément

Please check:
https://github.com/riscv/riscv-crypto/issues/364#issuecomment-1726782096

-Jerry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help