From: Conor Dooley <conor@kernel.org>
To: Evan Green <evan@rivosinc.com>
Cc: "Conor Dooley" <conor.dooley@microchip.com>,
"Samuel Ortiz" <sameo@rivosinc.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
linux-riscv@lists.infradead.org,
"Hongren (Zenithal) Zheng" <i@zenithal.me>,
linux@rivosinc.com, "Andrew Jones" <ajones@ventanamicro.com>,
"Heiko Stuebner" <heiko.stuebner@vrull.eu>,
"Anup Patel" <apatel@ventanamicro.com>,
linux-kernel@vger.kernel.org, "Guo Ren" <guoren@kernel.org>,
"Atish Patra" <atishp@rivosinc.com>,
"Björn Töpel" <bjorn@rivosinc.com>,
"Jiatai He" <jiatai2021@iscas.ac.cn>
Subject: Re: [PATCH 1/3] RISC-V: add Bitmanip/Scalar Crypto parsing from DT
Date: Wed, 28 Jun 2023 18:24:40 +0100 [thread overview]
Message-ID: <20230628-dragonish-lullaby-b44d2df09d66@spud> (raw)
In-Reply-To: <CALs-HstZe+bw_fY--4FQXfFoA67tvMSaEjKhZ2pRstNT07xBxA@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2952 bytes --]
On Wed, Jun 28, 2023 at 10:18:34AM -0700, Evan Green wrote:
> On Wed, Jun 28, 2023 at 4:10 AM Conor Dooley <conor.dooley@microchip.com> wrote:
> >
> > On Wed, Jun 28, 2023 at 12:01:11PM +0200, Samuel Ortiz wrote:
> > > On Tue, Jun 27, 2023 at 07:48:15PM +0100, Conor Dooley wrote:
> > > > On Tue, Jun 27, 2023 at 11:14:30AM -0700, Evan Green wrote:
> > > > > On Tue, Jun 27, 2023 at 7:38 AM Samuel Ortiz <sameo@rivosinc.com> wrote:
> >
> > > > > It would be nice to consolidate the ones together that search for a
> > > > > single string and set multiple bits, though I don't have any super
> > > > > elegant ideas for how off the top of my head.
> > > >
> > > > I've got a refactor of this code in progress, dropping all of these
> > > > copy-paste in place of a loop. It certainly looks more elegant than
> > > > this, but it will fall over a bit for these "one string matches many
> > > > extensions" cases. See here:
> > > > https://patchwork.kernel.org/project/linux-riscv/patch/20230626-thieving-jockstrap-d35d20b535c5@wendy/
> > > > My immediate thought is to add another element to riscv_isa_ext_data,
> > > > that contains "parent" extensions to check for. Should be fairly doable,
> > > > I'll whip something up on top of that...
> > >
> > > Nice, and thanks for the review.
> >
> > > Should I wait for your refactor to be merged before pushing this one?
> >
> > I don't know. I think that you should continue on with your series here,
> > and whichever goes in second gets rebased on top of the other.
> > I don't think it makes material difference to review of this patchset as
> > to whether you rebase on top of what I'm working on, so I wouldn't
> > bother until it gets merged.
> >
> > Rather hacky, had less time than expected this morning:
> > https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/commit/?h=riscv-extensions-strings-supersets
> > Clearly there's issues with looping to RISCV_ISA_MAX_SUPERSETS & I just
> > repurposed Zicsr for the sake of testing something in the time I had.
> >
> > Evan, at a high level, does that look more elegant to you, or have I made
> > things worse?
> >
>
> I see what you're going for at least. It's unfortunate that when
> someone bumps up RISCV_ISA_MAX_SUPERSETS it squares the whole array.
> Another way to go might be to define the elements in a separate array,
> like:
>
> unsigned int riscv_zks_exts[] = {
> RISCV_ISA_EXT_ZBKB,
> RISCV_ISA_EXT_ZBKC,
> ....
> };
>
> then the macro entry looks like:
>
> SET_ISA_EXT_MAP_MULTI("zks", riscv_zks_exts),
>
> where the SET_ISA_EXT_MAP_MULTI() could use ARRAY_SIZE() to stash both
> the pointer to the array and the number of elements.
Yup, I like the sound of that. I like the variadic stuff as it'd not
require defining a bunch of sub-arrays of supersets. I guess if it grows
too badly, we can just dump it off into another file or w/e.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-06-28 17:24 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 14:37 [PATCH 0/3] RISC-V: archrandom support Samuel Ortiz
2023-06-27 14:37 ` [PATCH 1/3] RISC-V: add Bitmanip/Scalar Crypto parsing from DT Samuel Ortiz
2023-06-27 18:14 ` Evan Green
2023-06-27 18:44 ` Hongren (Zenithal) Zheng
2023-06-27 18:48 ` Conor Dooley
2023-06-27 19:03 ` Hongren (Zenithal) Zheng
2023-06-27 19:18 ` Conor Dooley
2023-06-28 9:59 ` Samuel Ortiz
2023-06-28 10:01 ` Samuel Ortiz
2023-06-28 11:10 ` Conor Dooley
2023-06-28 12:30 ` Samuel Ortiz
2023-06-28 16:49 ` Conor Dooley
2023-06-28 17:18 ` Evan Green
2023-06-28 17:24 ` Conor Dooley [this message]
2023-07-03 17:39 ` Conor Dooley
2023-06-28 11:21 ` Markus Elfring
2023-06-28 12:29 ` Samuel Ortiz
2023-06-27 14:37 ` [PATCH 2/3] RISC-V: hwprobe: Expose Zbc and the scalar crypto extensions Samuel Ortiz
2023-06-27 18:13 ` Evan Green
2023-06-28 0:34 ` Stefan O'Rear
2023-06-28 10:04 ` Samuel Ortiz
2023-06-28 13:25 ` Stefan O'Rear
2023-07-10 7:59 ` Samuel Ortiz
2023-07-12 5:54 ` Stefan O'Rear
2023-06-27 14:37 ` [PATCH 3/3] RISC-V: Implement archrandom when Zkr is available Samuel Ortiz
2023-06-27 19:09 ` Conor Dooley
2023-06-28 12:28 ` Samuel Ortiz
2023-06-28 1:00 ` Stefan O'Rear
-- strict thread matches above, loose matches on Subject: below --
2022-04-30 13:48 [PATCH 0/3] RISC-V: Add Bitmanip/Scalar Crypto HWCAP Hongren (Zenithal) Zheng
2022-04-30 13:50 ` [PATCH 1/3] RISC-V: add Bitmanip/Scalar Crypto parsing from DT Hongren (Zenithal) Zheng
2022-05-03 23:21 ` Heiko Stuebner
2022-05-04 2:39 ` Hongren (Zenithal) Zheng
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=20230628-dragonish-lullaby-b44d2df09d66@spud \
--to=conor@kernel.org \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=atishp@rivosinc.com \
--cc=bjorn@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=evan@rivosinc.com \
--cc=guoren@kernel.org \
--cc=heiko.stuebner@vrull.eu \
--cc=i@zenithal.me \
--cc=jiatai2021@iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@rivosinc.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--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