[PATCH 2/3] riscv: Deprecate vector state prctl/sysctl
Radim Krcmar
rkrcmar at qti.qualcomm.com
Tue Oct 20 11:08:10 PDT 2026
2026-10-07T01:51:17-07:00, Samuel Holland <samuel.holland at sifive.com>:
> The ability to prevent userspace from executing vector instructions was
> provided as a escape hatch for software that was broken by adding vector
> state to the signal context. This appears to be unused in practice, and
> creates confusion in the extension support returned by hwprobe(), as in
> this one special case an extension reported as present by hwprobe() is
> unusable.
>
> Since we believe it is safe to always allow vector usage, hide the prctl
> and sysctl behind a Kconfig option and mark them as deprecated, so they
> can be removed in the future. Note that significant userspace software
> like glibc already considers these controls explicitly unsupported.
KVM on QEMU breaks because of -EINVAL:
static bool kvm_cpu_realize(CPUState *cs, Error **errp)
{ [...]
if (riscv_has_ext(&cpu->env, RVV)) {
ret = prctl(PR_RISCV_V_SET_CONTROL, PR_RISCV_V_VSTATE_CTRL_ON);
if (ret) {
error_setg_errno(errp, errno,
"Error in prctl PR_RISCV_V_SET_CONTROL");
return false;
}
}
We could have somewhat softer deprecations by defining that the vector
prctls succeed when user intent matches the current state and deny any
change.
Or is RISC-V still bold enough to "fix" userspace and hope for the best?
(High chance of Linus.)
>
> Signed-off-by: Samuel Holland <samuel.holland at sifive.com>
> ---
Would be nice to also update selftests and vector.rst.
Thanks.
More information about the linux-riscv
mailing list