[PW_SID:1102439] [[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state#2029
[PW_SID:1102439] [[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state#2029linux-riscv-bot wants to merge 1 commit into
Conversation
…state The last patch introduced the INITIAL vector state to avoid saving and restoring vector registers across syscall boundaries. However, this optimization did not fully account for the ptrace and signal handling interfaces. As a result, two issues emerged: 1. Ptrace reads at syscall stop could observe stale, non-nulled registers. 2. Modifications to the ucontext through signal interface during a syscall stop would be overwritten by the vector discaring macro. This patch introduces riscv_v_ucontext_save() to synchronize these paths with the INITIAL state: - Ptrace reads during a syscall stop now explicitly execute the hardware discard macro and return the discarded state to prevent data leaks. - Ptrace writes (PTRACE_SETREGSET) during a syscall stop are silently dropped (returning 0). Returning an error like EINVAL would break debbugers like GDB, which disables the optional regset on receiving such error. - Signal handling (rt_sigreturn) now honor user-space modifications to the vector context (for user-space thread schedulers). CC: Sergey Matyukevich <geomatsi@gmail.com> CC: gdb@sourceware.org Signed-off-by: Andy Chiu <tchiu@tenstorrent.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
|
Patch 1: "[[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state" |
PR for series 1102439 applied to workflow__riscv__fixes
Name: [[PATCH] v4 3/4] riscv: vector: adjust ptrace and signal behavior for INITIAL state
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1102439
Version: 1