From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>,
Chandan Rajendra <chandan@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 0/2] Fix function_graph tracer for ppc64 BE
Date: Mon, 30 Oct 2017 20:42:07 +0530 [thread overview]
Message-ID: <cover.1509374094.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
Chandan reported that trying to enable function_graph tracer on ppc64 BE
now locks up the system. This is due to prepare_ftrace_return() using
ppc_function_entry() for resolving return_to_handler(), which in turn
invokes kernel_text_address(), which also gets traced resulting in a
loop.
We added a check for kernel_text_address() in ppc_function_entry() to
guard all users in case we were called with a function, rather than a
function descriptor. In hindsight, I feel that this is inefficient since
we usually only pass function descriptors to ppc_function_entry() (and
ppc_global_function_entry()). So, I am proposing that we revert the
previous patch and instead implement the necessary checks in the kprobes
subsystem.
The other way to fix this is to simply guard the call to
kernel_text_address() within [un]pause_graph_tracing(), if you think
it's useful to have the check in ppc_function_entry() for all users.
- Naveen
Naveen N. Rao (2):
Revert "powerpc64/elfv1: Only dereference function descriptor for
non-text symbols"
powerpc/kprobes: Dereference function pointers only if the address
does not belong to kernel text
arch/powerpc/include/asm/code-patching.h | 10 +---------
arch/powerpc/kernel/kprobes.c | 7 ++++++-
2 files changed, 7 insertions(+), 10 deletions(-)
--
2.14.2
next reply other threads:[~2017-10-30 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 15:12 Naveen N. Rao [this message]
2017-10-30 15:12 ` [PATCH 1/2] Revert "powerpc64/elfv1: Only dereference function descriptor for non-text symbols" Naveen N. Rao
2017-11-02 12:12 ` [1/2] " Michael Ellerman
2017-10-30 15:12 ` [PATCH 2/2] powerpc/kprobes: Dereference function pointers only if the address does not belong to kernel text Naveen N. Rao
2017-11-02 12:12 ` [2/2] " 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=cover.1509374094.git.naveen.n.rao@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=chandan@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.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).