aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/kvm/vcpu_vector.c
diff options
context:
space:
mode:
authorVincent Chen <[email protected]>2023-06-05 11:07:12 +0000
committerPalmer Dabbelt <[email protected]>2023-06-08 07:16:48 -0700
commite92f469b0771e6db9688a58c0e34a8342da6a6bc (patch)
tree558ccc36a1d7a0584726c3722c79874ad144820e /arch/riscv/kvm/vcpu_vector.c
parent8ee0b41898fa26f66e32237f179b6989c65600d6 (diff)
riscv: signal: Report signal frame size to userspace via auxv
The vector register belongs to the signal context. They need to be stored and restored as entering and leaving the signal handler. According to the V-extension specification, the maximum length of the vector registers can be 2^16. Hence, if userspace refers to the MINSIGSTKSZ to create a sigframe, it may not be enough. To resolve this problem, this patch refers to the commit 94b07c1f8c39c ("arm64: signal: Report signal frame size to userspace via auxv") to enable userspace to know the minimum required sigframe size through the auxiliary vector and use it to allocate enough memory for signal context. Note that auxv always reports size of the sigframe as if V exists for all starting processes, whenever the kernel has CONFIG_RISCV_ISA_V. The reason is that users usually reference this value to allocate an alternative signal stack, and the user may use V anytime. So the user must reserve a space for V-context in sigframe in case that the signal handler invokes after the kernel allocating V. Signed-off-by: Greentime Hu <[email protected]> Signed-off-by: Vincent Chen <[email protected]> Signed-off-by: Andy Chiu <[email protected]> Acked-by: Conor Dooley <[email protected]> Reviewed-by: Björn Töpel <[email protected]> Reviewed-by: Guo Ren <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'arch/riscv/kvm/vcpu_vector.c')
0 files changed, 0 insertions, 0 deletions