]> www.infradead.org Git - users/willy/xarray.git/commit
riscv: vector: adjust minimum Vector requirement to ZVE32X
authorAndy Chiu <andy.chiu@sifive.com>
Thu, 9 May 2024 16:26:57 +0000 (00:26 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 30 May 2024 21:33:10 +0000 (14:33 -0700)
commitac295b67422d1a6627866453543b4880ab144572
treed4385fcda3aec1a1537408647f17d11877787b9c
parentde8f8282a969d0b7342702f355886aab3b14043d
riscv: vector: adjust minimum Vector requirement to ZVE32X

Make has_vector() to check for ZVE32X. Every in-kernel usage of V that
requires a more complicate version of V must then call out explicitly.

Also, change riscv_v_first_use_handler(), and boot code that calls
riscv_v_setup_vsize() to accept ZVE32X.

Most kernel/user interfaces requires minimum of ZVE32X. Thus, programs
compiled and run with ZVE32X should be supported by the kernel on most
aspects. This includes context-switch, signal, ptrace, prctl, and
hwprobe.

One exception is that ELF_HWCAP returns 'V' only if full V is supported
on the platform. This means that the system without a full V must not
rely on ELF_HWCAP to tell whether it is allowable to execute Vector
without first invoking a prctl() check.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Acked-by: Joel Granados <j.granados@samsung.com>
Link: https://lore.kernel.org/r/20240510-zve-detection-v5-7-0711bdd26c12@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/vector.h
arch/riscv/kernel/cpufeature.c
arch/riscv/kernel/sys_hwprobe.c
arch/riscv/kernel/vector.c
arch/riscv/lib/uaccess.S