Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: linux-riscv@lists.infradead.org
Subject: Re: [PATCH v1] Documentation: riscv: update Vector discovery for userspace
Date: Thu, 29 Jan 2026 17:48:46 +0200	[thread overview]
Message-ID: <5044566.GXAFRqVoOG@basile.remlab.net> (raw)

Hi,

Late to the party but...

> Make it explicit that users may use both HWCAP and
> PR_RISCV_V_GET_CONTROL for checking the availability of Vector
> extensions.

No? Some user-space checks HWCAP. Some check `hwprobe()` in line with 
Documentation/arch/riscv/hwprobe.rst in the same directory. Some check 
hwprobe() and fallback to HWCAP.

It's a few years too late to disallow using __riscv_hwprove() for this 
purpose.

> This addresses the ABI usage concern[1] arised from the user
> space community in supporting Vector sub-exts and multiversioning.

That looks to me that it only muddles the situation more rather than clarify 
it by recommending yet another way to detect Vectors that does not match what 
running code actually does.

If it were up to me, I would just deprecate the prctl() RVV controls. Their 
original intent appears to have been to allow running legacy non-vector code 
that would hypothetically not accomodate larger machine contexts in signal 
handling. However, given that Vectors are enabled by default, backward 
compatibility in that hypothetical scenario never actually existed. So it 
seems like it was merged as some kind of bad compromise / commitee design.

Alternatively, clarify that the RVV prctl()'s are only meant for, well, 
running legacy code that can't accomodate vector registers, and MUST NOT be 
used otherwise as it is known to break apps and libraries with runtime feature 
detection.

Or, but that's going to be controversial, and arguably also an ABI break, make 
hwprobe() account for the vector state of the process.

Br,

-- 
德尼-库尔蒙‧雷米
https://www.remlab.net/




_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2026-01-29 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 15:48 Rémi Denis-Courmont [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-07  0:06 [PATCH v1] Documentation: riscv: update Vector discovery for userspace Andy Chiu
2026-01-07 11:33 ` kernel test robot

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=5044566.GXAFRqVoOG@basile.remlab.net \
    --to=remi@remlab.net \
    --cc=linux-riscv@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox