diff options
| author | Yong-Xuan Wang <yongxuan.wang@sifive.com> | 2025-11-17 21:19:29 -0700 |
|---|---|---|
| committer | Paul Walmsley <pjw@kernel.org> | 2025-11-19 09:19:28 -0700 |
| commit | 6efb1a9462ef0023f3f96a7b88542e1f878e31a0 (patch) | |
| tree | d46c26c65297a46b91b4c3e89db512bbfd8b06d1 /rust/helpers/err.c | |
| parent | 3ac022bf389d60e696e4d3156b72f3ccd6e6368b (diff) | |
riscv: ptrace: Optimize the allocation of vector regset
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>
Diffstat (limited to 'rust/helpers/err.c')
0 files changed, 0 insertions, 0 deletions
