x86: Split syscall_trace_enter into two phases
authorAndy Lutomirski <luto@amacapital.net>
Fri, 5 Sep 2014 22:13:54 +0000 (15:13 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Mon, 8 Sep 2014 21:14:03 +0000 (14:14 -0700)
commite0ffbaabc46db508b8717f023c0ce03b980eefac
tree89ee63906648601f938b0e93655e1106c85e77b9
parentfd143b210e685f0c4b37895f03fb79cd0555b00d
x86: Split syscall_trace_enter into two phases

This splits syscall_trace_enter into syscall_trace_enter_phase1 and
syscall_trace_enter_phase2.  Only phase 2 has full pt_regs, and only
phase 2 is permitted to modify any of pt_regs except for orig_ax.

The intent is that phase 1 can be called from the syscall fast path.

In this implementation, phase1 can handle any combination of
TIF_NOHZ (RCU context tracking), TIF_SECCOMP, and TIF_SYSCALL_AUDIT,
unless seccomp requests a ptrace event, in which case phase2 is
forced.

In principle, this could yield a big speedup for TIF_NOHZ as well as
for TIF_SECCOMP if syscall exit work were similarly split up.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/2df320a600020fda055fccf2b668145729dd0c04.1409954077.git.luto@amacapital.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/ptrace.h
arch/x86/kernel/ptrace.c