]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: signal: abstract header saving for setup_sigcontext
authorAndy Chiu <andybnac@gmail.com>
Thu, 13 Nov 2025 00:43:14 +0000 (16:43 -0800)
committerPaul Walmsley <pjw@kernel.org>
Fri, 19 Dec 2025 07:18:33 +0000 (00:18 -0700)
commit818d78ba1b3f88d2bfee249f25020211488a26c3
treeaacada70804318cfbb5fbf9e4938600250f61443
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8
riscv: signal: abstract header saving for setup_sigcontext

The function save_v_state() served two purposes. First, it saved
extension context into the signal stack. Then, it constructed the
extension header if there was no fault. The second part is independent
of the extension itself. As a result, we can pull that part out, so
future extensions may reuse it. This patch adds arch_ext_list and makes
setup_sigcontext() go through all possible extensions' save() callback.
The callback returns a positive value indicating the size of the
successfully saved extension. Then the kernel proceeds to construct the
header for that extension. The kernel skips an extension if it does
not exist, or if the saving fails for some reasons. The error code is
propagated out on the later case.

This patch does not introduce any functional changes.

Signed-off-by: Andy Chiu <andybnac@gmail.com>
Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-16-b55691eacf4f@rivosinc.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/vector.h
arch/riscv/kernel/signal.c