From: "Clément Léger" <cleger@rivosinc.com>
To: Conor Dooley <conor@kernel.org>, linux-riscv@lists.infradead.org
Cc: Conor Dooley <conor.dooley@microchip.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
Date: Wed, 17 Jul 2024 15:34:06 +0200 [thread overview]
Message-ID: <cba0c880-a1b2-4bb8-bef0-d280d87ec308@rivosinc.com> (raw)
In-Reply-To: <20240717-dedicate-squeamish-7e4ab54df58f@spud>
On 17/07/2024 10:54, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
>
> Currently the entries appear to be in a random order (although according
> to Palmer he has tried to sort them by key value) which makes it harder
> to find entries in a growing list, and more likely to have conflicts as
> all patches are adding to the end of the list. Sort them alphabetically
> instead.
>
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> CC: Paul Walmsley <paul.walmsley@sifive.com>
> CC: Palmer Dabbelt <palmer@dabbelt.com>
> CC: linux-riscv@lists.infradead.org
> CC: linux-kernel@vger.kernel.org
> ---
> arch/riscv/kernel/sys_hwprobe.c | 43 ++++++++++++++++-----------------
> 1 file changed, 21 insertions(+), 22 deletions(-)
>
> diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c
> index 685594769535..8a1c9ce170e8 100644
> --- a/arch/riscv/kernel/sys_hwprobe.c
> +++ b/arch/riscv/kernel/sys_hwprobe.c
> @@ -93,44 +93,45 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
> * regardless of the kernel's configuration, as no other checks, besides
> * presence in the hart_isa bitmap, are made.
> */
> + EXT_KEY(ZACAS);
> + EXT_KEY(ZAWRS);
> EXT_KEY(ZBA);
> EXT_KEY(ZBB);
> - EXT_KEY(ZBS);
> - EXT_KEY(ZICBOZ);
> EXT_KEY(ZBC);
> -
> EXT_KEY(ZBKB);
> EXT_KEY(ZBKC);
> EXT_KEY(ZBKX);
> + EXT_KEY(ZBS);
> + EXT_KEY(ZCA);
> + EXT_KEY(ZCB);
> + EXT_KEY(ZCMOP);
> + EXT_KEY(ZICBOZ);
> + EXT_KEY(ZICOND);
> + EXT_KEY(ZIHINTNTL);
> + EXT_KEY(ZIHINTPAUSE);
> + EXT_KEY(ZIMOP);
> EXT_KEY(ZKND);
> EXT_KEY(ZKNE);
> EXT_KEY(ZKNH);
> EXT_KEY(ZKSED);
> EXT_KEY(ZKSH);
> EXT_KEY(ZKT);
> - EXT_KEY(ZIHINTNTL);
> EXT_KEY(ZTSO);
> - EXT_KEY(ZACAS);
> - EXT_KEY(ZICOND);
> - EXT_KEY(ZIHINTPAUSE);
> - EXT_KEY(ZIMOP);
> - EXT_KEY(ZCA);
> - EXT_KEY(ZCB);
> - EXT_KEY(ZCMOP);
> - EXT_KEY(ZAWRS);
>
> /*
> * All the following extensions must depend on the kernel
> * support of V.
> */
> if (has_vector()) {
> - EXT_KEY(ZVE32X);
> - EXT_KEY(ZVE32F);
> - EXT_KEY(ZVE64X);
> - EXT_KEY(ZVE64F);
> - EXT_KEY(ZVE64D);
> EXT_KEY(ZVBB);
> EXT_KEY(ZVBC);
> + EXT_KEY(ZVE32F);
> + EXT_KEY(ZVE32X);
> + EXT_KEY(ZVE64D);
> + EXT_KEY(ZVE64F);
> + EXT_KEY(ZVE64X);
> + EXT_KEY(ZVFH);
> + EXT_KEY(ZVFHMIN);
> EXT_KEY(ZVKB);
> EXT_KEY(ZVKG);
> EXT_KEY(ZVKNED);
> @@ -139,16 +140,14 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
> EXT_KEY(ZVKSED);
> EXT_KEY(ZVKSH);
> EXT_KEY(ZVKT);
> - EXT_KEY(ZVFH);
> - EXT_KEY(ZVFHMIN);
> }
>
> if (has_fpu()) {
> - EXT_KEY(ZFH);
> - EXT_KEY(ZFHMIN);
> - EXT_KEY(ZFA);
> EXT_KEY(ZCD);
> EXT_KEY(ZCF);
> + EXT_KEY(ZFA);
> + EXT_KEY(ZFH);
> + EXT_KEY(ZFHMIN);
> }
> #undef EXT_KEY
> }
I'd prefer that to be done after removing the "if
(has_vector()/has_fpu()) by using the .validate callback for ISA
extension. This way, you'll have only a single commit reordering everything.
Thanks,
Clément
next prev parent reply other threads:[~2024-07-17 13:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 8:54 Conor Dooley
2024-07-17 13:34 ` Clément Léger [this message]
2024-07-17 13:42 ` Conor Dooley
2024-07-17 13:47 ` Clément Léger
2024-07-23 12:58 ` patchwork-bot+linux-riscv
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=cba0c880-a1b2-4bb8-bef0-d280d87ec308@rivosinc.com \
--to=cleger@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.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
all inboxes | Powered by JetHome®