linux-stable/arch/powerpc/lib
Naveen N. Rao 71f6e58e5e powerpc/kprobes: Convert __kprobes to NOKPROBE_SYMBOL()
Along similar lines as commit 9326638cbe ("kprobes, x86: Use NOKPROBE_SYMBOL()
instead of __kprobes annotation"), convert __kprobes annotation to either
NOKPROBE_SYMBOL() or nokprobe_inline. The latter forces inlining, in which case
the caller needs to be added to NOKPROBE_SYMBOL().

Also:
 - blacklist arch_deref_entry_point(), and
 - convert a few regular inlines to nokprobe_inline in lib/sstep.c

A key benefit is the ability to detect such symbols as being
blacklisted. Before this patch:

  $ cat /sys/kernel/debug/kprobes/blacklist | grep read_mem
  $ perf probe read_mem
  Failed to write event: Invalid argument
    Error: Failed to add events.
  $ dmesg | tail -1
  [ 3736.112815] Could not insert probe at _text+10014968: -22

After patch:
  $ cat /sys/kernel/debug/kprobes/blacklist | grep read_mem
  0xc000000000072b50-0xc000000000072d20	read_mem
  $ perf probe read_mem
  read_mem is blacklisted function, skip it.
  Added new events:
    (null):(null)        (on read_mem)
    probe:read_mem       (on read_mem)

  You can now use it in all perf tools, such as:

	  perf record -e probe:read_mem -aR sleep 1

  $ grep " read_mem" /proc/kallsyms
  c000000000072b50 t read_mem
  c0000000005f3b40 t read_mem
  $ cat /sys/kernel/debug/kprobes/list
  c0000000005f3b48  k  read_mem+0x8    [DISABLED]

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
[mpe: Minor change log formatting, fix up some conflicts]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-04-23 20:32:25 +10:00
..
alloc.c treewide: replace obsolete _refok by __ref 2016-08-02 17:31:41 -04:00
checksum_32.S powerpc: EX_TABLE macro for exception tables 2016-11-14 11:11:51 +11:00
checksum_64.S powerpc/64: Use optimized checksum routines on little-endian 2017-01-25 13:34:18 +11:00
checksum_wrappers.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
code-patching.c powerpc/kprobes: Convert __kprobes to NOKPROBE_SYMBOL() 2017-04-23 20:32:25 +10:00
copy_32.S powerpc: EX_TABLE macro for exception tables 2016-11-14 11:11:51 +11:00
copypage_64.S powerpc/64: Fix naming of cache block vs. cache line 2017-02-06 19:46:04 +11:00
copypage_power7.S powerpc: Change vrX register defines to vX to match gcc and glibc 2015-03-16 18:32:11 +11:00
copyuser_64.S powerpc: EX_TABLE macro for exception tables 2016-11-14 11:11:51 +11:00
copyuser_power7.S powerpc: EX_TABLE macro for exception tables 2016-11-14 11:11:51 +11:00
crtsavres.S powerpc: Change vrX register defines to vX to match gcc and glibc 2015-03-16 18:32:11 +11:00
div64.S
feature-fixups-test.S powerpc: Ensure the else case of feature sections will fit 2011-01-21 14:08:33 +11:00
feature-fixups.c sched/headers: Prepare to remove the <linux/mm_types.h> dependency from <linux/sched.h> 2017-03-02 08:42:37 +01:00
hweight_64.S ppc: move exports to definitions 2016-08-07 23:50:09 -04:00
ldstfp.S powerpc: EX_TABLE macro for exception tables 2016-11-14 11:11:51 +11:00
locks.c powerpc/spinlock: Fix spin_unlock_wait() 2016-06-14 16:05:44 +10:00
Makefile powerpc: emulate_step() tests for load/store instructions 2017-03-03 11:24:50 +11:00
mem_64.S Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
memcmp_64.S ppc: move exports to definitions 2016-08-07 23:50:09 -04:00
memcpy_64.S ppc: move exports to definitions 2016-08-07 23:50:09 -04:00
memcpy_power7.S powerpc: Change vrX register defines to vX to match gcc and glibc 2015-03-16 18:32:11 +11:00
rheap.c powerpc: Various typo fixes 2016-06-14 13:58:26 +10:00
sstep.c powerpc/kprobes: Convert __kprobes to NOKPROBE_SYMBOL() 2017-04-23 20:32:25 +10:00
string.S powerpc: EX_TABLE macro for exception tables 2016-11-14 11:11:51 +11:00
string_64.S powerpc/64: Fix naming of cache block vs. cache line 2017-02-06 19:46:04 +11:00
test_emulate_step.c powerpc: emulate_step() tests for load/store instructions 2017-03-03 11:24:50 +11:00
usercopy_64.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
vmx-helper.c powerpc: Introduce asm-prototypes.h 2016-06-16 22:39:54 +10:00
xor_vmx.c powerpc: rework sparse for lib/xor_vmx.c 2016-04-27 09:33:37 +10:00