From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Steven James <pyro@linuxlabs.com>
Subject: Re: [uml-devel] [PATCH] RFC allow PTRACE_SYSCALL to selectively skip syscalls
Date: Wed, 17 May 2006 08:20:30 +0200 [thread overview]
Message-ID: <200605170820.30922.blaisorblade@yahoo.it> (raw)
In-Reply-To: <Pine.LNX.4.58.0605111220070.664@ucontrol.mobiledns.com>
On Saturday 13 May 2006 19:40, Steven James wrote:
> 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.
Just to make things clearer: is this a different API than SYSEMU to do the
same thing, as it seems? If so, is it faster by any way, or just more elegant
in your opinion, or what? I think it's as fast as SYSEMU since you must
switch to the tracer on the syscall entry, look at params, set the result and
switch back with a ptrace call, with PTRACE_SYSEMU in my case, with
PTRACE_SYSCALL (?) in your case.
The current problem with PTRACE_SYSEMU is that you decide whether you'll skip
the syscall before looking at parameters (other people have already
complained about this). If this is the problem you have, I'll recover the
past discussions and let you know.
> 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.
What if the tracing thread must set -ENOSYS as the return value?
@@ -644,16 +644,24 @@
send_sig(current->exit_code, current, 1);
current->exit_code = 0;
}
+ if(regs->rax != -ENOSYS)
+ return 1;
+
+ return 0;
}
--
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
-------------------------------------------------------
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2006-05-17 6:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-13 17:40 [uml-devel] [PATCH] RFC allow PTRACE_SYSCALL to selectively skip syscalls Steven James
2006-05-16 15:10 ` Jeff Dike
2006-05-16 17:45 ` Steven James
2006-05-17 6:20 ` Blaisorblade [this message]
2006-05-17 14:45 ` Steven James
2006-05-19 14:09 ` Blaisorblade
2006-05-21 17:36 ` Blaisorblade
2006-05-21 23:58 ` Steven James
2006-05-22 9:15 ` Blaisorblade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605170820.30922.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=pyro@linuxlabs.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox