From: Jeff Dike <jdike@addtoit.com>
To: Renzo Davoli <renzo@cs.unibo.it>
Cc: LKML <linux-kernel@vger.kernel.org>, Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH 0/1] ptrace_vm: let us simplify the code for ptrace and add useful features for VM
Date: Tue, 17 Jun 2008 12:25:11 -0400 [thread overview]
Message-ID: <20080617162511.GA7223@c2.user-mode-linux.org> (raw)
In-Reply-To: <20080616075804.GA6950@cs.unibo.it>
On Mon, Jun 16, 2008 at 09:58:04AM +0200, Renzo Davoli wrote:
> Summary of the solution:
> Use tags in the "addr" parameter of existing
> PTRACE_SYSCALL/PTRACE_SINGLESTEP/PTRACE_CONT/PTRACE_BLOCKSTEP calls
> to skip the current call (PTRACE_VM_SKIPCALL) or skip the second upcall to
> the VM/debugger after the syscall execution (PTRACE_VM_SKIPEXIT).
On the whole, I'm in favor of generalizing ptrace, especially if it
also simplifies the interface and code. Some notes below...
> I already proposed some time ago a different tag: PTRACE_SYSVM
> (and I maintain a patch for it) where:
> ptrace(PTRACE_SYSVM, pid, XXX, 0)
> 1* is the same as PTRACE_SYSCALL when XXX==0,
> 2* skips the call (and stops before entering the next syscall) when
> PTRACE_VM_SKIPCALL | PTRACE_VM_SKIPEXIT
There's a symmetry implied in the PTRACE_VM_SKIPCALL and
PTRACE_VM_SKIPEXIT names which doesn't exist in reality. SKIPEXIT (as
you note later) merely omits the notification on system call return.
SKIPCALL keeps the notification, but omits the system call execution,
so the effects are very different from each other.
I think this is just a naming issue - we don't want the names to fake
people into assuming things which aren't true.
> SYSVM can be used also for partial virtual machines (some syscall gets
> virtualized and some others do not), like our umview.
BTW, if performance is the issue here (and I don't see any other
compelling reasons for it), there are other possibilities which
provide much better performance. Any PTRACE_* variant will have at
least one notification. While there is a noticable gain over two
notifications, that's marginal compared to no notifications at all.
If you know ahead of time what system calls you want to trace, a
system call tracing mask lets you avoid those notifications totally.
I wrote up a patch a couple of years ago -
http://marc.info/?l=user-mode-linux-devel&m=114495242202954&w=2
but the interface implemented there isn't very good.
Jeff
--
Work email - jdike at linux dot intel dot com
next prev parent reply other threads:[~2008-06-17 16:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-16 7:58 [PATCH 0/1] ptrace_vm: let us simplify the code for ptrace and add useful features for VM Renzo Davoli
2008-06-17 16:25 ` Jeff Dike [this message]
2008-06-17 19:08 ` Renzo Davoli
2008-06-18 16:49 ` Jeff Dike
2008-06-22 9:11 ` Renzo Davoli
2008-06-27 17:50 ` Jeff Dike
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=20080617162511.GA7223@c2.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=renzo@cs.unibo.it \
--cc=roland@redhat.com \
/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