Re: [PATCH] riscv: hwprobe: require both F and D extensions for RISCV_HWPROBE_IMA_FD

Conor Dooley <[email protected]>
Newsgroups org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel
Message-ID <20260818-uninstall-opposite-b713ce801f5c@spud>
On Mon, Aug 17, 2026 at 03:15:07PM -0600, Ivy Lopez wrote:
> On Mon, Aug 17, 2026 at 03:14:36PM +0100, Conor Dooley wrote:
> > The kernel never supports F without D, so this cannot occur.
> > riscv_isa_extension_available(NULL, f) always returns false if D is not
> > also present.
> >
> > If anything, the code in has_fpu() should be changed to only check D and
> > not F to match expectations elsewhere, or F and D for the same reason.
> 
> Ah ok, thanks for the clarification.. I hadn't realized F-without-D is
> already structurally impossible here, so this patch doesn't change
> actual behavior.
> 
> Would you prefer a v2 that fixes has_fpu() instead (checking D only,
> or F && D, whichever matches the intended semantics elsewhere), or
> would you rather I just drop this patch since RISCV_HWPROBE_IMA_FD already
> behaves correctly in practice?
> 
> Happy to send whichever you'd find useful!

I think I would rather see has_fpu() get changed. I think checking
either D only (ideally with a comment explaining why that's correct to
do) or checking both are equally valid, which to do is up to you.

I don't think there's really any other equivalents to this has_fpu()
code because anything that would do it just calls has_fpu() instead!
The closest thing to it that I found is code in cpufeature.c that only
checks D (with comments), but that code is part of the wider extension
parsing logic that where the block on F without D happens in the first
place, so it may not be the best example.

In the future, when replying, please try to keep more than just one mail
of context, to make it easier for people to follow the conversation if
this is the only mail they read or if they forgot exactly what was going
on in the previous ones.

Cheers,
Conor.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCaoQpvgAKCRB4tDGHoIJi
0p8XAP90QgkBM+N2QT+XtDm/msMcyWeJrpYVPoOLdAxGPL3dpQEAkNSaf9PWQMhQ
BWvah9YbgBwis1ciOb639ZyaGQSu4wU=
=Ftnu
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.