All of lore.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Ivy Lopez <skunkolee@gmail.com>
Cc: conor.dooley@microchip.com, alex@ghiti.fr,
	andrew.jones@oss.qualcomm.com, aou@eecs.berkeley.edu,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	palmer@dabbelt.com, pjw@kernel.org
Subject: Re: [PATCH] riscv: hwprobe: require both F and D extensions for RISCV_HWPROBE_IMA_FD
Date: Tue, 18 Aug 2026 10:45:34 +0100	[thread overview]
Message-ID: <20260818-uninstall-opposite-b713ce801f5c@spud> (raw)
In-Reply-To: <20260817211507.28685-1-skunkolee@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]

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.



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Conor Dooley <conor@kernel.org>
To: Ivy Lopez <skunkolee@gmail.com>
Cc: conor.dooley@microchip.com, alex@ghiti.fr,
	andrew.jones@oss.qualcomm.com, aou@eecs.berkeley.edu,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	palmer@dabbelt.com, pjw@kernel.org
Subject: Re: [PATCH] riscv: hwprobe: require both F and D extensions for RISCV_HWPROBE_IMA_FD
Date: Tue, 18 Aug 2026 10:45:34 +0100	[thread overview]
Message-ID: <20260818-uninstall-opposite-b713ce801f5c@spud> (raw)
In-Reply-To: <20260817211507.28685-1-skunkolee@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1803 bytes --]

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.



[-- 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

  reply	other threads:[~2026-08-18  9:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16  0:32 [PATCH] riscv: hwprobe: require both F and D extensions for RISCV_HWPROBE_IMA_FD Ivy Lopez
2026-08-16  0:32 ` Ivy Lopez
2026-08-17 14:14 ` Conor Dooley
2026-08-17 14:14   ` Conor Dooley
2026-08-17 21:15   ` Ivy Lopez
2026-08-17 21:15     ` Ivy Lopez
2026-08-18  9:45     ` Conor Dooley [this message]
2026-08-18  9:45       ` Conor Dooley
2026-08-18 10:19     ` Andreas Schwab
2026-08-18 10:19       ` Andreas Schwab
2026-08-25 14:20 ` [PATCH v2] riscv: hwprobe: fix has_fpu() to require D extension only Ivy Lopez
2026-08-25 14:20   ` Ivy Lopez
2026-08-25 17:11   ` Conor Dooley
2026-08-25 17:11     ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260818-uninstall-opposite-b713ce801f5c@spud \
    --to=conor@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=andrew.jones@oss.qualcomm.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor.dooley@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=skunkolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.