[PATCH 4/5] On x86, EAX read on syscall entry is not necessary

Denys Vlasenko dvlasenk at redhat.com
Wed Aug 24 09:13:29 UTC 2011


On Tue, 2011-08-23 at 23:18 +0400, Dmitry V. Levin wrote:
> On Mon, Aug 22, 2011 at 12:28:59PM +0200, Denys Vlasenko wrote:
> > On Mon, 2011-08-22 at 12:21 +0200, Denys Vlasenko wrote:
> > > 4. Another speedup: on x86, EAX read on syscall entry is also not
> > > necessary if we know that post-execve SIGTRAP is disabled by
> > > PTRACE_O_TRACEEXEC ptrace option. This patch (a) moves EAX retrieval
> > > from syscall_fixup to get_scno_on_sysexit, and (b) perform EAX retrieval
> > > in syscall_fixup only if we are in syscall entry and PTRACE_O_TRACEEXEC
> > > option is not on.
> 
> If the sysexit part of this EAX retrieval code goes to
> get_scno_on_sysexit(), why the sysenter part of it doesn't go to
> get_scno_on_sysenter() as well?

EAX retrieval has nothing to do with getting syscall no, so it should
not be in get_scno_on_sysenter().

get_scno_on_sysexit() is a total misnomer, and should be renamed,
something like get_retval_on_sysexit(). As opposed to
get_scno_on_sysenter(), it makes a lot of sense to retrieve EAX there.

Therefore there should be no symmetry between get_scno_on_sysenter()
and get_scno_on_sysexit(). This is a false impression caused by their
names being similar.

-- 
vda







More information about the Strace-devel mailing list