* [PATCH] riscv: cpufeature: add validation for zfa, zfh and zfhmin
@ 2025-05-27 10:00 Clément Léger
2025-05-28 14:39 ` Conor Dooley
2025-08-06 17:15 ` patchwork-bot+linux-riscv
0 siblings, 2 replies; 3+ messages in thread
From: Clément Léger @ 2025-05-27 10:00 UTC (permalink / raw)
To: linux-riscv, linux-kernel
Cc: Clément Léger, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Alexandre Ghiti
These extensions depends on the F one. Add a validation callback
checking for the F extension to be present. Now that extensions are
correctly reported using the F/D presence, we can remove the
has_fpu() check in hwprobe_isa_ext0().
Signed-off-by: Clément Léger <cleger@rivosinc.com>
---
arch/riscv/kernel/cpufeature.c | 6 +++---
arch/riscv/kernel/sys_hwprobe.c | 14 ++++++--------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 2054f6c4b0ae..dc258dbe4dd9 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -457,10 +457,10 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
__RISCV_ISA_EXT_DATA(zacas, RISCV_ISA_EXT_ZACAS),
__RISCV_ISA_EXT_DATA(zalrsc, RISCV_ISA_EXT_ZALRSC),
__RISCV_ISA_EXT_DATA(zawrs, RISCV_ISA_EXT_ZAWRS),
- __RISCV_ISA_EXT_DATA(zfa, RISCV_ISA_EXT_ZFA),
+ __RISCV_ISA_EXT_DATA_VALIDATE(zfa, RISCV_ISA_EXT_ZFA, riscv_ext_f_depends),
__RISCV_ISA_EXT_DATA_VALIDATE(zfbfmin, RISCV_ISA_EXT_ZFBFMIN, riscv_ext_f_depends),
- __RISCV_ISA_EXT_DATA(zfh, RISCV_ISA_EXT_ZFH),
- __RISCV_ISA_EXT_DATA(zfhmin, RISCV_ISA_EXT_ZFHMIN),
+ __RISCV_ISA_EXT_DATA_VALIDATE(zfh, RISCV_ISA_EXT_ZFH, riscv_ext_f_depends),
+ __RISCV_ISA_EXT_DATA_VALIDATE(zfhmin, RISCV_ISA_EXT_ZFHMIN, riscv_ext_f_depends),
__RISCV_ISA_EXT_DATA(zca, RISCV_ISA_EXT_ZCA),
__RISCV_ISA_EXT_DATA_VALIDATE(zcb, RISCV_ISA_EXT_ZCB, riscv_ext_zca_depends),
__RISCV_ISA_EXT_DATA_VALIDATE(zcd, RISCV_ISA_EXT_ZCD, riscv_ext_zcd_validate),
diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c
index 249aec8594a9..a3dd31379262 100644
--- a/arch/riscv/kernel/sys_hwprobe.c
+++ b/arch/riscv/kernel/sys_hwprobe.c
@@ -151,14 +151,12 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
EXT_KEY(ZVKT);
}
- if (has_fpu()) {
- EXT_KEY(ZCD);
- EXT_KEY(ZCF);
- EXT_KEY(ZFA);
- EXT_KEY(ZFBFMIN);
- EXT_KEY(ZFH);
- EXT_KEY(ZFHMIN);
- }
+ EXT_KEY(ZCD);
+ EXT_KEY(ZCF);
+ EXT_KEY(ZFA);
+ EXT_KEY(ZFBFMIN);
+ EXT_KEY(ZFH);
+ EXT_KEY(ZFHMIN);
if (IS_ENABLED(CONFIG_RISCV_ISA_SUPM))
EXT_KEY(SUPM);
--
2.49.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] riscv: cpufeature: add validation for zfa, zfh and zfhmin
2025-05-27 10:00 [PATCH] riscv: cpufeature: add validation for zfa, zfh and zfhmin Clément Léger
@ 2025-05-28 14:39 ` Conor Dooley
2025-08-06 17:15 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2025-05-28 14:39 UTC (permalink / raw)
To: Clément Léger
Cc: linux-riscv, linux-kernel, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti
[-- Attachment #1.1: Type: text/plain, Size: 425 bytes --]
On Tue, May 27, 2025 at 12:00:00PM +0200, Clément Léger wrote:
> These extensions depends on the F one. Add a validation callback
> checking for the F extension to be present. Now that extensions are
> correctly reported using the F/D presence, we can remove the
> has_fpu() check in hwprobe_isa_ext0().
>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
[-- 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] 3+ messages in thread
* Re: [PATCH] riscv: cpufeature: add validation for zfa, zfh and zfhmin
2025-05-27 10:00 [PATCH] riscv: cpufeature: add validation for zfa, zfh and zfhmin Clément Léger
2025-05-28 14:39 ` Conor Dooley
@ 2025-08-06 17:15 ` patchwork-bot+linux-riscv
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-riscv @ 2025-08-06 17:15 UTC (permalink / raw)
To: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2VyIDxjbGVnZXJAcml2b3NpbmMuY29tPg==?=
Cc: linux-riscv, linux-kernel, paul.walmsley, palmer, aou, alex
Hello:
This patch was applied to riscv/linux.git (for-next)
by Alexandre Ghiti <alexghiti@rivosinc.com>:
On Tue, 27 May 2025 12:00:00 +0200 you wrote:
> These extensions depends on the F one. Add a validation callback
> checking for the F extension to be present. Now that extensions are
> correctly reported using the F/D presence, we can remove the
> has_fpu() check in hwprobe_isa_ext0().
>
> Signed-off-by: Clément Léger <cleger@rivosinc.com>
>
> [...]
Here is the summary with links:
- riscv: cpufeature: add validation for zfa, zfh and zfhmin
https://git.kernel.org/riscv/c/3de29352aaeb
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] 3+ messages in thread
end of thread, other threads:[~2025-08-06 17:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 10:00 [PATCH] riscv: cpufeature: add validation for zfa, zfh and zfhmin Clément Léger
2025-05-28 14:39 ` Conor Dooley
2025-08-06 17:15 ` 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;
as well as URLs for NNTP newsgroup(s).