[EXT] Re: [PATCH 1/2] riscv: hwprobe: export the availability of vector to user

Florian Weimer fweimer at redhat.com
Wed Aug 5 23:31:48 PDT 2026


* Peter Bergner:

>> We only get a true userspace simplification over hwprobe + prctl if we
>> can disable vector extension usage if the kernel does not support
>> RISCV_HWPROBE_KEY_EXT_ENABLED (so a V usage regression for older
>> kernels).  Otherwise we'd have to use the new approach and, as a
>> fallback, the old combination of hwprobe and prctl.
>
> Since the kernel ignores unknown keys, we do get a userspace simplification
> over hwprobe + prctl.  The plan is for our GLIBC IFUNC resolvers to just have
> one hwprobe call (as they do now) with RISCV_HWPROBE_KEY_EXT_ENABLED as the
> first key and RISCV_HWPROBE_KEY_IMA_EXT_0 as the second key.

And if RISCV_HWPROBE_KEY_IMA_EXT_0 comes back at -1, we'd turn on V
unconditionally?  That still leaves the existing bug on old kernels, but
at least the bug goes away with a kernel upgrade.  This isn't too bad.

Thanks,
Florian




More information about the linux-riscv mailing list