Skip to content

Commit c3abcab

Browse files
committed
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "This includes a fix for a crash if certain special addresses are kprobed, plus does a rename of two Kconfig variables that were a minor misnomer" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed
2 parents 500e1af + 9d020d3 commit c3abcab

File tree

13 files changed

+23
-23
lines changed

13 files changed

+23
-23
lines changed

Documentation/trace/kprobetrace.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ kprobes can probe (this means, all functions body except for __kprobes
1212
functions). Unlike the Tracepoint based event, this can be added and removed
1313
dynamically, on the fly.
1414

15-
To enable this feature, build your kernel with CONFIG_KPROBE_EVENT=y.
15+
To enable this feature, build your kernel with CONFIG_KPROBE_EVENTS=y.
1616

1717
Similar to the events tracer, this doesn't need to be activated via
1818
current_tracer. Instead of that, add probe points via

Documentation/trace/uprobetracer.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Overview
88
--------
99
Uprobe based trace events are similar to kprobe based trace events.
10-
To enable this feature, build your kernel with CONFIG_UPROBE_EVENT=y.
10+
To enable this feature, build your kernel with CONFIG_UPROBE_EVENTS=y.
1111

1212
Similar to the kprobe-event tracer, this doesn't need to be activated via
1313
current_tracer. Instead of that, add probe points via

arch/s390/configs/default_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ CONFIG_SCHED_TRACER=y
609609
CONFIG_FTRACE_SYSCALLS=y
610610
CONFIG_STACK_TRACER=y
611611
CONFIG_BLK_DEV_IO_TRACE=y
612-
CONFIG_UPROBE_EVENT=y
612+
CONFIG_UPROBE_EVENTS=y
613613
CONFIG_FUNCTION_PROFILER=y
614614
CONFIG_HIST_TRIGGERS=y
615615
CONFIG_TRACE_ENUM_MAP_FILE=y

arch/s390/configs/gcov_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ CONFIG_SCHED_TRACER=y
560560
CONFIG_FTRACE_SYSCALLS=y
561561
CONFIG_STACK_TRACER=y
562562
CONFIG_BLK_DEV_IO_TRACE=y
563-
CONFIG_UPROBE_EVENT=y
563+
CONFIG_UPROBE_EVENTS=y
564564
CONFIG_FUNCTION_PROFILER=y
565565
CONFIG_HIST_TRIGGERS=y
566566
CONFIG_TRACE_ENUM_MAP_FILE=y

arch/s390/configs/performance_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ CONFIG_SCHED_TRACER=y
558558
CONFIG_FTRACE_SYSCALLS=y
559559
CONFIG_STACK_TRACER=y
560560
CONFIG_BLK_DEV_IO_TRACE=y
561-
CONFIG_UPROBE_EVENT=y
561+
CONFIG_UPROBE_EVENTS=y
562562
CONFIG_FUNCTION_PROFILER=y
563563
CONFIG_HIST_TRIGGERS=y
564564
CONFIG_TRACE_ENUM_MAP_FILE=y

arch/s390/defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ CONFIG_FTRACE_SYSCALLS=y
179179
CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y
180180
CONFIG_STACK_TRACER=y
181181
CONFIG_BLK_DEV_IO_TRACE=y
182-
CONFIG_UPROBE_EVENT=y
182+
CONFIG_UPROBE_EVENTS=y
183183
CONFIG_FUNCTION_PROFILER=y
184184
CONFIG_TRACE_ENUM_MAP_FILE=y
185185
CONFIG_KPROBES_SANITY_TEST=y

arch/x86/kernel/kprobes/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
#endif
6868

6969
/* Ensure if the instruction can be boostable */
70-
extern int can_boost(kprobe_opcode_t *instruction);
70+
extern int can_boost(kprobe_opcode_t *instruction, void *addr);
7171
/* Recover instruction if given address is probed */
7272
extern unsigned long recover_probed_instruction(kprobe_opcode_t *buf,
7373
unsigned long addr);

arch/x86/kernel/kprobes/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ NOKPROBE_SYMBOL(skip_prefixes);
167167
* Returns non-zero if opcode is boostable.
168168
* RIP relative instructions are adjusted at copying time in 64 bits mode
169169
*/
170-
int can_boost(kprobe_opcode_t *opcodes)
170+
int can_boost(kprobe_opcode_t *opcodes, void *addr)
171171
{
172172
kprobe_opcode_t opcode;
173173
kprobe_opcode_t *orig_opcodes = opcodes;
174174

175-
if (search_exception_tables((unsigned long)opcodes))
175+
if (search_exception_tables((unsigned long)addr))
176176
return 0; /* Page fault may occur on this address. */
177177

178178
retry:
@@ -417,7 +417,7 @@ static int arch_copy_kprobe(struct kprobe *p)
417417
* __copy_instruction can modify the displacement of the instruction,
418418
* but it doesn't affect boostable check.
419419
*/
420-
if (can_boost(p->ainsn.insn))
420+
if (can_boost(p->ainsn.insn, p->addr))
421421
p->ainsn.boostable = 0;
422422
else
423423
p->ainsn.boostable = -1;

arch/x86/kernel/kprobes/opt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int copy_optimized_instructions(u8 *dest, u8 *src)
178178

179179
while (len < RELATIVEJUMP_SIZE) {
180180
ret = __copy_instruction(dest + len, src + len);
181-
if (!ret || !can_boost(dest + len))
181+
if (!ret || !can_boost(dest + len, src + len))
182182
return -EINVAL;
183183
len += ret;
184184
}

kernel/trace/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ config BLK_DEV_IO_TRACE
429429

430430
If unsure, say N.
431431

432-
config KPROBE_EVENT
432+
config KPROBE_EVENTS
433433
depends on KPROBES
434434
depends on HAVE_REGS_AND_STACK_ACCESS_API
435435
bool "Enable kprobes-based dynamic events"
@@ -447,7 +447,7 @@ config KPROBE_EVENT
447447
This option is also required by perf-probe subcommand of perf tools.
448448
If you want to use perf tools, this option is strongly recommended.
449449

450-
config UPROBE_EVENT
450+
config UPROBE_EVENTS
451451
bool "Enable uprobes-based dynamic events"
452452
depends on ARCH_SUPPORTS_UPROBES
453453
depends on MMU
@@ -466,7 +466,7 @@ config UPROBE_EVENT
466466

467467
config BPF_EVENTS
468468
depends on BPF_SYSCALL
469-
depends on (KPROBE_EVENT || UPROBE_EVENT) && PERF_EVENTS
469+
depends on (KPROBE_EVENTS || UPROBE_EVENTS) && PERF_EVENTS
470470
bool
471471
default y
472472
help

0 commit comments

Comments
 (0)