]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Mon, 15 Dec 2014 14:50:31 +0000 (20:20 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 23 Jan 2015 03:02:51 +0000 (14:02 +1100)
commitbf794bf52a80c6278a028f0af2ca32d7c3508c9b
tree99156d7b3fa258a370e097cfe0a2ae04cd67616d
parent10ea834364c8670b3bf9bbbf6b9d27b4d2ebc9de
powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2

Currently, all non-dot symbols are being treated as function descriptors
in ABIv1. This is incorrect and is resulting in perf probe not working:

  # perf probe do_fork
  Added new event:
  Failed to write event: Invalid argument
    Error: Failed to add events.
  # dmesg | tail -1
  [192268.073063] Could not insert probe at _text+768432: -22

perf probe bases all kernel probes on _text and writes,
for example, "p:probe/do_fork _text+768432" to
/sys/kernel/debug/tracing/kprobe_events. In-kernel, _text is being
considered to be a function descriptor and is resulting in the above
error.

Fix this by changing how we lookup symbol addresses on ppc64. We first
check for the dot variant of a symbol and look at the non-dot variant
only if that fails. In this manner, we avoid having to look at the
function descriptor.

While at it, also separate out how this works on ABIv2 where
we don't have dot symbols, but need to use the local entry point.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/kprobes.h