[PATCH v3] riscv: hwprobe: fix has_fpu() to require D extension only
Conor Dooley
conor at kernel.org
Wed Aug 26 02:06:52 PDT 2026
On Wed, Aug 26, 2026 at 07:53:05AM +0200, Andreas Schwab wrote:
> On Aug 25 2026, Ivy Lopez wrote:
>
> > The kernel never supports F without D, since D depends on F. As such,
> D without F
|The kernel never supports F without D, since D depends on F. As such,
|has_fpu() checking either extension with '||' is incorrect: it
|reports FPU support when only F is present, which is not sufficient
|for D-dependent state save/restore, and weakens
|RISCV_HWPROBE_IMA_FD semantics to "F or D" instead of "F and D".
Thinking about it, this whole thing really is not right.
> The kernel never supports F without D
This is actually correct, the kernel itself doesn't support doing this.
> since D depends on F
But this is not the rationale, the rationale is simplicity of
implementation etc.
> As such,
> has_fpu() checking either extension with '||' is incorrect: it
> reports FPU support when only F is present, which is not sufficient
And this cannot happen, because the kernel will not enable F support if D
is not present, it clears the relevant flag during devicetree/acpi
parsing.
> for D-dependent state save/restore, and weakens
> RISCV_HWPROBE_IMA_FD semantics to "F or D" instead of "F and D".
The reason I would cite for changing the is matching the expectations
set elsewhere in the kernel, rather than impact on userspace or
behaviour, since F without D is not possible so there's no potential
impact here at all.
Cheers,
Conor.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20260826/eade0a2f/attachment.sig>
More information about the linux-riscv
mailing list