Greetings,

I have been working on a few experimental system calls using a ptrace
mechanism similar to UML to implement the calls. Naturally this lead me to
look at PTRACE_SYSEMU vs. PTRACE_SYSCALL. Since the extra system calls are
implemented entirely by the ptrace thread it seems a shame to take the
context switch on entry and exit from the call. In some cases, I need to
also implement a few of the standard Linux kernel calls in the ptrace
thread as well, based on parameters of the call (for example, writes to
specific open files).

The patch below for x86_64 implements a scheme where a ptraced system call
is skipped if the ptrace thread sets a return value (in RAX) when it
handles the syscall entry. Otherwise things proceed normally.

A similar change is even easier on i386 since the needed logic is already
in entry.S for SYSEMU.

I chose changing RAX as the trigger since that is otherwise a useless
thing for a tracing thread to do at syscall entry.

G'day,
sjames


||||| |||| |||||||||||||  |||
by Linux Labs International, Inc.
   Steven James, CTO

55 Marietta Street
Suite 1830
Atlanta, Ga 30303
866 824 9737 support



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to