From: Conor Dooley <conor@kernel.org>
To: "Clément Léger" <cleger@rivosinc.com>
Cc: linux-riscv@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
Palmer Dabbelt <palmer@rivosinc.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Albert Ou <aou@eecs.berkeley.edu>,
Jonathan Corbet <corbet@lwn.net>,
Andrew Jones <ajones@ventanamicro.com>,
Evan Green <evan@rivosinc.com>, Samuel Ortiz <sameo@rivosinc.com>,
Conor Dooley <conor.dooley@microchip.com>
Subject: Re: [PATCH v3 03/20] riscv: add ISA extension parsing for scalar crypto
Date: Wed, 8 Nov 2023 15:17:43 +0000 [thread overview]
Message-ID: <20231108-mystify-marshland-0e35c4524899@spud> (raw)
In-Reply-To: <20231107105556.517187-4-cleger@rivosinc.com>
[-- Attachment #1: Type: text/plain, Size: 2058 bytes --]
On Tue, Nov 07, 2023 at 11:55:39AM +0100, Clément Léger wrote:
> From: Evan Green <evan@rivosinc.com>
>
> The Scalar Crypto specification defines Zk as a shorthand for the
> Zkn, Zkr and Zkt extensions. The same follows for both Zkn, Zks and Zbk,
> which are all shorthands for various other extensions. The detailed
> breakdown can be found in their dt-binding entries.
>
> Since Zkn also implies the Zbkb, Zbkc and Zbkx extensions, simply passing
> "zk" through a DT should enable all of Zbkb, Zbkc, Zbkx, Zkn, Zkr and Zkt.
> For example, setting the "riscv,isa" DT property to "rv64imafdc_zk"
> should generate the following cpuinfo output:
> "rv64imafdc_zicntr_zicsr_zifencei_zihpm_zbkb_zbkc_zbkx_zknd_zkne_zknh_zkr_zkt"
>
> riscv_isa_ext_data grows a pair of new members, to permit setting the
> relevant bits for "bundled" extensions, both while parsing the ISA string
> and the new dedicated extension properties.
>
> Co-developed-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Evan Green <evan@rivosinc.com>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>
> +static void __init match_isa_ext(const struct riscv_isa_ext_data *ext, const char *name,
> + const char *name_end, struct riscv_isainfo *isainfo)
> +{
> + if ((name_end - name == strlen(ext->name)) &&
> + !strncasecmp(name, ext->name, name_end - name)) {
> + /*
> + * If this is a bundle, enable all the ISA extensions that
> + * comprise the bundle.
> + */
> + if (ext->subset_ext_size) {
> + for (int i = 0; i < ext->subset_ext_size; i++) {
> + if (riscv_isa_extension_check(ext->subset_ext_ids[i]))
> + set_bit(ext->subset_ext_ids[i], isainfo->isa);
> + }
> + }
> +
> + if (riscv_isa_extension_check(ext->id))
> + set_bit(ext->id, isainfo->isa);
Could you add a comment here please about how this is safe to do for the
bundle extensions?
Otherwise,
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-11-08 15:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 10:55 [PATCH v3 00/20] riscv: report more ISA extensions through hwprobe Clément Léger
2023-11-07 10:55 ` [PATCH v3 01/20] riscv: hwprobe: factorize hwprobe ISA extension reporting Clément Léger
2023-11-07 10:55 ` [PATCH v3 02/20] riscv: hwprobe: export missing Zbc ISA extension Clément Léger
2023-11-07 10:55 ` [PATCH v3 03/20] riscv: add ISA extension parsing for scalar crypto Clément Léger
2023-11-08 15:17 ` Conor Dooley [this message]
2023-11-08 17:24 ` Evan Green
2023-11-07 10:55 ` [PATCH v3 04/20] riscv: hwprobe: add support for scalar crypto ISA extensions Clément Léger
2023-11-07 10:55 ` [PATCH v3 05/20] dt-bindings: riscv: add scalar crypto ISA extensions description Clément Léger
2023-11-08 14:57 ` Conor Dooley
2023-11-08 15:11 ` Clément Léger
2023-11-07 10:55 ` [PATCH v3 06/20] riscv: add ISA extension parsing for vector crypto Clément Léger
2023-11-09 2:58 ` Jerry Shih
2023-11-09 7:44 ` Conor Dooley
2023-11-09 7:54 ` Conor Dooley
2023-11-09 9:45 ` Jerry Shih
2023-11-09 10:39 ` Clément Léger
2023-11-07 10:55 ` [PATCH v3 07/20] riscv: hwprobe: export vector crypto ISA extensions Clément Léger
2023-11-07 10:55 ` [PATCH v3 08/20] dt-bindings: riscv: add vector crypto ISA extensions description Clément Léger
2023-11-07 10:55 ` [PATCH v3 09/20] riscv: add ISA extension parsing for Zfh/Zfh[min] Clément Léger
2023-11-07 10:55 ` [PATCH v3 10/20] riscv: hwprobe: export Zfh[min] ISA extensions Clément Léger
2023-11-07 10:55 ` [PATCH v3 11/20] dt-bindings: riscv: add Zfh[min] ISA extensions description Clément Léger
2023-11-07 10:55 ` [PATCH v3 12/20] riscv: add ISA extension parsing for Zihintntl Clément Léger
2023-11-07 10:55 ` [PATCH v3 13/20] riscv: hwprobe: export Zhintntl ISA extension Clément Léger
2023-11-07 10:55 ` [PATCH v3 14/20] dt-bindings: riscv: add Zihintntl ISA extension description Clément Léger
2023-11-07 10:55 ` [PATCH v3 15/20] riscv: add ISA extension parsing for Zvfh[min] Clément Léger
2023-11-07 10:55 ` [PATCH v3 16/20] riscv: hwprobe: export Zvfh[min] ISA extensions Clément Léger
2023-11-07 10:55 ` [PATCH v3 17/20] dt-bindings: riscv: add Zvfh[min] ISA extension description Clément Léger
2023-11-07 10:55 ` [PATCH v3 18/20] riscv: add ISA extension parsing for Zfa Clément Léger
2023-11-07 10:55 ` [PATCH v3 19/20] riscv: hwprobe: export Zfa ISA extension Clément Léger
2023-11-07 10:55 ` [PATCH v3 20/20] dt-bindings: riscv: add Zfa ISA extension description Clément Léger
2023-11-08 14:59 ` Conor Dooley
2023-11-09 10:42 ` Clément Léger
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=20231108-mystify-marshland-0e35c4524899@spud \
--to=conor@kernel.org \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=cleger@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=evan@rivosinc.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@rivosinc.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
--cc=sameo@rivosinc.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;
as well as URLs for NNTP newsgroup(s).