Re: [PATCH v3] riscv: hwprobe: fix has_fpu() to require D extension only
From: Conor Dooley
Date: Wed Aug 26 2026 - 05:07:07 EST
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.
Attachment:
signature.asc
Description: PGP signature