Re: [PATCH v2 1/2] powerpc: Restore all registers after a traced syscall again
From: Madhavan Srinivasan
Date: Mon Nov 30 2026 - 07:27:19 EST
On Wed, 14 Oct 2026 13:06:51 +0200, Michal Suchanek wrote:
> syscall_exit_prepare() asks the exit assembly to reload all GPRs, CTR
> and XER from pt_regs only if the thread flags contain any of the flags
> in _TIF_SYSCALL_DOTRACE. With the new entry code based GENERIC_ENTRY the
> flags are no longer set.
>
> This breaks tracers that modify a stopped syscall, for example ones that
> re-execute the syscall instruction by moving the NIP back by 4 at the
> syscall-exit stop with the syscall number put back into r0: the sc then
> runs with r0 = 0, which is __NR_restart_syscall. dettrace fails like
> this with "No filter rule for system call: restart_syscall". A tracer
> that writes r4 at the syscall-exit stop of an sc sees the tracee
> continue with r4 = 0 instead; with a 7.1 kernel both work.
>
> [...]
Applied to powerpc/next.
[1/2] powerpc: Restore all registers after a traced syscall again
https://git.kernel.org/powerpc/c/ddb295763e25062636b81caf4dcad61f924e5618
[2/2] powerpc: Remove unused thread info flags
https://git.kernel.org/powerpc/c/378d5f96ab4d0a9ffc1a1db1dd5727bf46b55f70
cheers