diff options
| author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2014-04-17 04:17:05 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-04-24 04:02:56 -0400 |
| commit | 376e242429bf8539ef39a080ac113c8799840b13 (patch) | |
| tree | 33c871f48d37acd167de0b3bf5c902ce4aaa325c /include/asm-generic | |
| parent | be8f274323c26ddc7e6fd6c44254b7abcdbe6389 (diff) | |
kprobes: Introduce NOKPROBE_SYMBOL() macro to maintain kprobes blacklist
Introduce NOKPROBE_SYMBOL() macro which builds a kprobes
blacklist at kernel build time.
The usage of this macro is similar to EXPORT_SYMBOL(),
placed after the function definition:
NOKPROBE_SYMBOL(function);
Since this macro will inhibit inlining of static/inline
functions, this patch also introduces a nokprobe_inline macro
for static/inline functions. In this case, we must use
NOKPROBE_SYMBOL() for the inline function caller.
When CONFIG_KPROBES=y, the macro stores the given function
address in the "_kprobe_blacklist" section.
Since the data structures are not fully initialized by the
macro (because there is no "size" information), those
are re-initialized at boot time by using kallsyms.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Link: http://lkml.kernel.org/r/20140417081705.26341.96719.stgit@ltc230.yrl.intra.hitachi.co.jp
Cc: Alok Kataria <akataria@vmware.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christopher Li <sparse@chrisli.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jan-Simon Möller <dl9pf@gmx.de>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-arch@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-sparse@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/asm-generic')
| -rw-r--r-- | include/asm-generic/vmlinux.lds.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 146e4fffd710..40ceb3ceba79 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -109,6 +109,14 @@ | |||
| 109 | #define BRANCH_PROFILE() | 109 | #define BRANCH_PROFILE() |
| 110 | #endif | 110 | #endif |
| 111 | 111 | ||
| 112 | #ifdef CONFIG_KPROBES | ||
| 113 | #define KPROBE_BLACKLIST() VMLINUX_SYMBOL(__start_kprobe_blacklist) = .; \ | ||
| 114 | *(_kprobe_blacklist) \ | ||
| 115 | VMLINUX_SYMBOL(__stop_kprobe_blacklist) = .; | ||
| 116 | #else | ||
| 117 | #define KPROBE_BLACKLIST() | ||
| 118 | #endif | ||
| 119 | |||
| 112 | #ifdef CONFIG_EVENT_TRACING | 120 | #ifdef CONFIG_EVENT_TRACING |
| 113 | #define FTRACE_EVENTS() . = ALIGN(8); \ | 121 | #define FTRACE_EVENTS() . = ALIGN(8); \ |
| 114 | VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | 122 | VMLINUX_SYMBOL(__start_ftrace_events) = .; \ |
| @@ -507,6 +515,7 @@ | |||
| 507 | *(.init.rodata) \ | 515 | *(.init.rodata) \ |
| 508 | FTRACE_EVENTS() \ | 516 | FTRACE_EVENTS() \ |
| 509 | TRACE_SYSCALLS() \ | 517 | TRACE_SYSCALLS() \ |
| 518 | KPROBE_BLACKLIST() \ | ||
| 510 | MEM_DISCARD(init.rodata) \ | 519 | MEM_DISCARD(init.rodata) \ |
| 511 | CLK_OF_TABLES() \ | 520 | CLK_OF_TABLES() \ |
| 512 | RESERVEDMEM_OF_TABLES() \ | 521 | RESERVEDMEM_OF_TABLES() \ |
