* [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
@ 2024-07-17 8:54 Conor Dooley
2024-07-17 13:34 ` Clément Léger
2024-07-23 12:58 ` patchwork-bot+linux-riscv
0 siblings, 2 replies; 5+ messages in thread
From: Conor Dooley @ 2024-07-17 8:54 UTC (permalink / raw)
To: linux-riscv
Cc: conor, Conor Dooley, Paul Walmsley, Palmer Dabbelt, linux-kernel
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
}
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
2024-07-17 8:54 [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically Conor Dooley
@ 2024-07-17 13:34 ` Clément Léger
2024-07-17 13:42 ` Conor Dooley
2024-07-23 12:58 ` patchwork-bot+linux-riscv
1 sibling, 1 reply; 5+ messages in thread
From: Clément Léger @ 2024-07-17 13:34 UTC (permalink / raw)
To: Conor Dooley, linux-riscv
Cc: Conor Dooley, Paul Walmsley, Palmer Dabbelt, linux-kernel
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
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
2024-07-17 13:34 ` Clément Léger
@ 2024-07-17 13:42 ` Conor Dooley
2024-07-17 13:47 ` Clément Léger
0 siblings, 1 reply; 5+ messages in thread
From: Conor Dooley @ 2024-07-17 13:42 UTC (permalink / raw)
To: Clément Léger
Cc: linux-riscv, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1427 bytes --]
On Wed, Jul 17, 2024 at 03:34:06PM +0200, Clément Léger wrote:
> 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>
> > 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.
Right, and I do have some WIP for that here
https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/log/?h=validate_fpu_and_vector
but won't be sending that until it's cleaned up after the merge window.
I was intentionally sending this during it so that there would be no
moving pieces for this to conflict with - because it will conflict with
any other patch adding things to the list tails.
[-- 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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
2024-07-17 13:42 ` Conor Dooley
@ 2024-07-17 13:47 ` Clément Léger
0 siblings, 0 replies; 5+ messages in thread
From: Clément Léger @ 2024-07-17 13:47 UTC (permalink / raw)
To: Conor Dooley
Cc: linux-riscv, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
linux-kernel
On 17/07/2024 15:42, Conor Dooley wrote:
> On Wed, Jul 17, 2024 at 03:34:06PM +0200, Clément Léger wrote:
>> 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>
>>> 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.
>
> Right, and I do have some WIP for that here
> https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/log/?h=validate_fpu_and_vector
> but won't be sending that until it's cleaned up after the merge window.
> I was intentionally sending this during it so that there would be no
> moving pieces for this to conflict with - because it will conflict with
> any other patch adding things to the list tails.
Makes sense. If you think it's worth it:
Reviewed-by: Clément Léger <cleger@rivosinc.com>
Thanks,
Clément
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
2024-07-17 8:54 [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically Conor Dooley
2024-07-17 13:34 ` Clément Léger
@ 2024-07-23 12:58 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-07-23 12:58 UTC (permalink / raw)
To: Conor Dooley
Cc: linux-riscv, conor.dooley, paul.walmsley, palmer, linux-kernel
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Wed, 17 Jul 2024 09:54:38 +0100 you 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.
>
> [...]
Here is the summary with links:
- [v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically
https://git.kernel.org/riscv/c/3d8d459c8ba2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-23 12:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 8:54 [PATCH v1] RISC-V: hwprobe: sort EXT_KEY()s in hwprobe_isa_ext0() alphabetically Conor Dooley
2024-07-17 13:34 ` Clément Léger
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox