This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC] [PATCH 2.6.37-rc5-tip 10/20] 10: uprobes: task specific information.
- From: Roland McGrath <roland at redhat dot com>
- To: Josh Stone <jistone at redhat dot com>
- Cc: Peter Zijlstra <peterz at infradead dot org>, Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>, Ingo Molnar <mingo at elte dot hu>, Steven Rostedt <rostedt at goodmis dot org>, Arnaldo Carvalho de Melo <acme at infradead dot org>, Linus Torvalds <torvalds at linux-foundation dot org>, Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, Christoph Hellwig <hch at infradead dot org>, Andi Kleen <andi at firstfloor dot org>, Oleg Nesterov <oleg at redhat dot com>, LKML <linux-kernel at vger dot kernel dot org>, SystemTap <systemtap at sources dot redhat dot com>, Linux-mm <linux-mm at vger dot kernel dot org>, Jim Keniston <jkenisto at linux dot vnet dot ibm dot com>, Frederic Weisbecker <fweisbec at gmail dot com>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Andrew Morton <akpm at linux-foundation dot org>, "Paul E. McKenney" <paulmck at linux dot vnet dot ibm dot com>
- Date: Tue, 25 Jan 2011 10:55:44 -0800 (PST)
- Subject: Re: [RFC] [PATCH 2.6.37-rc5-tip 10/20] 10: uprobes: task specific information.
- References: <20101216095714.23751.52601.sendpatchset@localhost6.localdomain6> <20101216095912.23751.63180.sendpatchset@localhost6.localdomain6> <1295963775.28776.1056.camel@laptop> <4D3F1897.60300@redhat.com>
> On 01/25/2011 05:56 AM, Peter Zijlstra wrote:
> > Ah, I think I found it while reading patch 13, you need the pre/post_xol
> > callbacks, can't you simply synthesize their effect into the replacement
> > sequence?
> >
> > push %rax
> > mov $vaddr, %rax
> > $INSN
> > pop %rax
> > jmp $next_insn
> >
> > like replacements would obviate the need for the pre/post callbacks and
> > allow you to run straight through.
>
> For this particular example, you'd better be sure that $INSN doesn't
> need %rsp intact.
In general it is quite bad form to touch the user's stack at all for
instrumentation purposes. Unexpected stack usage might be what you are
trying to debug, after all.
On x86-64 in particular, it is strictly verboten to touch the user's stack
immediately below the SP. In the x86-64 ABI, the 128 bytes below %rsp are
a scratch area for leaf functions that normal compiled user code will use
to store data that must not be clobbered. (Normal signal handler frames
start 128 bytes below %rsp for this reason.)
That's aside from the more obvious issues Josh mentioned, where the
instruction itself is a push/pop/call/ret or uses an addressing mode
relative to %rsp.
Thanks,
Roland