+21
−3
Loading
The vector regset uses the maximum possible vlen value to estimate the .n field. But not all the hardwares support the maximum vlen. Linux might wastes time to prepare a large memory buffer(about 2^6 pages) for the vector regset. The regset can only copy vector registers when the process are using vector. Add .active callback and determine the n field of vector regset in riscv_v_setup_ctx_cache() doesn't affect the ptrace syscall and coredump. It can avoid oversized allocations and better matches real hardware limits. Signed-off-by:Yong-Xuan Wang <yongxuan.wang@sifive.com> Reviewed-by:
Greentime Hu <greentime.hu@sifive.com> Reviewed-by:
Andy Chiu <andybnac@gmail.com> Tested-by:
Andy Chiu <andybnac@gmail.com> Link: https://patch.msgid.link/20251013091318.467864-2-yongxuan.wang@sifive.com Signed-off-by:
Paul Walmsley <pjw@kernel.org>