x86 ptrace: unify syscall tracing
This unifies and cleans up the syscall tracing code on i386 and x86_64.
Using a single function for entry and exit tracing on 32-bit made the
do_syscall_trace() into some terrible spaghetti. The logic is clear and
simple using separate syscall_trace_enter() and syscall_trace_leave()
functions as on 64-bit.
The unification adds PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support
on x86_64, for 32-bit ptrace() callers and for 64-bit ptrace() callers
tracing either 32-bit or 64-bit tasks. It behaves just like 32-bit.
Changing syscall_trace_enter() to return the syscall number shortens
all the assembly paths, while adding the SYSEMU feature in a simple way.
Signed-off-by:
Roland McGrath <roland@redhat.com>
Showing
- arch/x86/ia32/ia32entry.S 9 additions, 8 deletionsarch/x86/ia32/ia32entry.S
- arch/x86/kernel/entry_32.S 7 additions, 12 deletionsarch/x86/kernel/entry_32.S
- arch/x86/kernel/entry_64.S 9 additions, 5 deletionsarch/x86/kernel/entry_64.S
- arch/x86/kernel/ptrace.c 46 additions, 95 deletionsarch/x86/kernel/ptrace.c
- include/asm-x86/calling.h 4 additions, 2 deletionsinclude/asm-x86/calling.h
- include/asm-x86/ptrace-abi.h 3 additions, 3 deletionsinclude/asm-x86/ptrace-abi.h
- include/asm-x86/thread_info.h 10 additions, 7 deletionsinclude/asm-x86/thread_info.h
Please register or sign in to comment