Skip to contentSkip to conversation

Documentation: riscv: update Vector discovery for userspace

PATCH Rémi Denis-Courmont 1 participant 1 message Jan 29 RISC-V

lore
Share & tools
lore
#0 lore raw

Hi,

Late to the party but...

Quoted 3 lines

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.

Quoted 2 lines

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,

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




_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv