linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	Gustavo Luiz Duarte <gduarte@redhat.com>,
	zsun@redhat.com, linuxppc-dev@lists.ozlabs.org,
	Pratyush Anand <panand@redhat.com>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH] powerpc/uprobes: Implement arch_uretprobe_is_alive()
Date: Wed, 14 Jun 2017 23:05:38 -0700	[thread overview]
Message-ID: <20170615060538.GA56680@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170614154400.17377-1-naveen.n.rao@linux.vnet.ibm.com>

Adding Oleg and Pratyush to the cc.

> This helper is used to detect if a uprobe'd function has returned
> through a setjmp/longjmp, rather than branching to the LR that was
> updated previously by us. This fixes a SIGSEGV that gets generated when
> programs use setjmp/longjmp with uretprobes.
> 
> We use the arm64 model (arch/arm64/kernel/probes/uprobes.c:
> arch_uretprobe_is_alive()) for detecting when stack frames have been
> removed from under us.
> 
> Reference:
> https://marc.info/?l=linux-kernel&m=143748610330073
> commit 7b868e4802a86 ("uprobes/x86: Reimplement arch_uretprobe_is_alive()")
> commit db087ef69a2b1 ("uprobes/x86: Make arch_uretprobe_is_alive(RP_CHECK_CALL) more
> clever")
> 
> Tested with the test program from:
> https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=blob;f=testsuite/systemtap.base/bz5274.c;hb=HEAD
> 
> And this script:
>     $ cat test.sh
>     #!/bin/bash
> 
>     perf probe -x ./bz5274 -a bz5274_main_return=main%return
>     perf probe -x ./bz5274 -a bz5274_funca_return=funca%return
>     perf probe -x ./bz5274 -a bz5274_funcb_return=funcb%return
>     perf probe -x ./bz5274 -a bz5274_funcc_return=funcc%return
>     perf probe -x ./bz5274 -a bz5274_funcd_return=funcd%return
> 
>     perf record -e 'probe_bz5274:*' -aR ./bz5274
> 
> Reported-by: Gustavo Luiz Duarte <gduarte@redhat.com>
> Reported-by: zsun@redhat.com
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Looks good to me.

Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

  reply	other threads:[~2017-06-15  6:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 15:44 [PATCH] powerpc/uprobes: Implement arch_uretprobe_is_alive() Naveen N. Rao
2017-06-15  6:05 ` Srikar Dronamraju [this message]
2017-08-31 11:36 ` Michael Ellerman

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=20170615060538.GA56680@linux.vnet.ibm.com \
    --to=srikar@linux.vnet.ibm.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=gduarte@redhat.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=oleg@redhat.com \
    --cc=panand@redhat.com \
    --cc=zsun@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;
as well as URLs for NNTP newsgroup(s).