linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jim Keniston <jkenisto@linux.vnet.ibm.com>
To: ananth@in.ibm.com
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	oleg@redhat.com, lkml <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Anton Blanchard <anton@samba.org>, Ingo Molnar <mingo@elte.hu>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] [POWERPC] uprobes: powerpc port
Date: Wed, 06 Jun 2012 11:08:04 -0700	[thread overview]
Message-ID: <1339006084.3458.25.camel@localhost> (raw)
In-Reply-To: <20120606093541.GA29580@in.ibm.com>

On Wed, 2012-06-06 at 15:05 +0530, Ananth N Mavinakayanahalli wrote:
> On Wed, Jun 06, 2012 at 11:27:02AM +0200, Peter Zijlstra wrote:
> > On Wed, 2012-06-06 at 14:51 +0530, Ananth N Mavinakayanahalli wrote:
> > > One TODO in this port compared to x86 is the uprobe abort_xol() logic.
> > > x86 depends on the thread_struct.trap_nr (absent in powerpc) to determine
> > > if a signal was caused when the uprobed instruction was single-stepped/
> > > emulated, in which case, we reset the instruction pointer to the probed
> > > address and retry the probe again. 
> > 
> > Another curious difference is that x86 uses an instruction decoder and
> > contains massive tables to validate we can probe a particular
> > instruction.

Part of that difference is because the x86 instruction set is a lot more
complex.  Another part is due to the lack, back when the x86 code was
created, of robust handling by uprobes of traps by probed instructions.
So we refused to probe instructions that we knew (or strongly suspected)
would generate traps in user mode -- e.g., privileged instructions,
illegal instructions.  A couple of times we had to "legalize"
instructions or prefixes that we didn't originally expect to encounter.

> > 
> > Can we probe all possible PPC instructions?
> 
> For the kernel, the only ones that are off limits are rfi (return from
> interrupt), mtmsr (move to msr). All other instructions can be probed.
> 
> Both those instructions are supervisor level, so we won't see them in
> userspace at all; so we should be able to probe all user level
> instructions.

Presumably rfi or mtmsr could show up in the instruction stream via an
erroneous or mischievous asm statement.  It'd be good to verify that you
handle that gracefully.

> 
> I am not aware of specific caveats for vector/altivec instructions;
> maybe Paul or Ben are more suitable to comment on that.
> 
> Ananth
> 

Jim

  reply	other threads:[~2012-06-06 18:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  9:19 [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn() Ananth N Mavinakayanahalli
2012-06-06  9:21 ` [PATCH 2/2] [POWERPC] uprobes: powerpc port Ananth N Mavinakayanahalli
2012-06-06  9:27   ` Peter Zijlstra
2012-06-06  9:35     ` Ananth N Mavinakayanahalli
2012-06-06 18:08       ` Jim Keniston [this message]
2012-06-08  4:36         ` Ananth N Mavinakayanahalli
2012-06-08  5:51           ` Michael Ellerman
2012-06-08  6:01             ` Ananth N Mavinakayanahalli
2012-06-08  6:17               ` Michael Ellerman
2012-06-08  6:19                 ` Ananth N Mavinakayanahalli
2012-06-08  6:38                   ` Michael Ellerman
2012-06-08  9:21                     ` Ananth N Mavinakayanahalli
2012-06-12  4:01                       ` Michael Ellerman
2012-06-12  4:52                         ` Ananth N Mavinakayanahalli
2012-06-06  9:23 ` [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn() Peter Zijlstra
2012-06-06  9:37   ` Ananth N Mavinakayanahalli
2012-06-06  9:40     ` Ingo Molnar
2012-06-06 10:22       ` Ananth N Mavinakayanahalli
2012-06-06 11:44       ` Srikar Dronamraju
2012-06-08  4:33         ` Ananth N Mavinakayanahalli
2012-06-06 15:08 ` Oleg Nesterov
2012-06-06 16:30   ` Srikar Dronamraju

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=1339006084.3458.25.camel@localhost \
    --to=jkenisto@linux.vnet.ibm.com \
    --cc=ananth@in.ibm.com \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=srikar@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).