[PATCH v1 1/1] riscv: Add RVV memset via multiarch/IFUNC

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Fri Oct 31 16:48:07 GMT 2025



On 31/10/25 13:25, Yao Zihong wrote:
> My understanding is that the kernel may eventually make riscv_hwprobe
> reflect whether an extension is enabled, not just present, but that is
> not the case today.
> 
> I’m unsure whether it is glibc’s responsibility to cover this gap in the
> meantime.
> If it is, then perhaps we should gate the RVV path on both riscv_hwprobe
> (to ensure V = 1.0 capability) and dl_hwcap.V (to respect per-process enablement
> via prctl/sysctl).
> 
> Do you think this should be handled in glibc or left for the kernel side?

This can be fixed on glibc if we have a release kernel with the prctl support
(I have not check which version PR_RISCV_V_VSTATE_CTRL_* was added).

The main problem is now you will need to extend hwcap support on all software
stack, libgcc seems only to consult hwcap for function multi-versioning support
so PR_RISCV_V_VSTATE_CTRL_OFF potentially broke any current usage of it.  

There is also all __riscv_hwprobe consumers that might only assume it as the
authoritative source of hardware support. You will also need to know check
mask-off RISCV_HWPROBE_IMA_V if the hwcap is not set. 


More information about the Libc-alpha mailing list