]> Git Repo - linux.git/commit
perf/x86/intel: Fix unwind errors from PEBS entries (mk-II)
authorPeter Zijlstra <[email protected]>
Thu, 10 May 2018 13:48:41 +0000 (15:48 +0200)
committerIngo Molnar <[email protected]>
Wed, 25 Jul 2018 09:46:21 +0000 (11:46 +0200)
commit6cbc304f2f360f25cc8607817239d6f4a2fd3dc5
treeba5faab5782a441ef6ba482fbfc9d2444efc4024
parent4799f6856fdd38c8078a190eca3288029287cf66
perf/x86/intel: Fix unwind errors from PEBS entries (mk-II)

Vince reported the perf_fuzzer giving various unwinder warnings and
Josh reported:

> Deja vu.  Most of these are related to perf PEBS, similar to the
> following issue:
>
>   b8000586c90b ("perf/x86/intel: Cure bogus unwind from PEBS entries")
>
> This is basically the ORC version of that.  setup_pebs_sample_data() is
> assembling a franken-pt_regs which ORC isn't happy about.  RIP is
> inconsistent with some of the other registers (like RSP and RBP).

And where the previous unwinder only needed BP,SP ORC also requires
IP. But we cannot spoof IP because then the sample will get displaced,
entirely negating the point of PEBS.

So cure the whole thing differently by doing the unwind early; this
does however require a means to communicate we did the unwind early.
We (ab)use an unused sample_type bit for this, which we set on events
that fill out the data->callchain before the normal
perf_prepare_sample().

Debugged-by: Josh Poimboeuf <[email protected]>
Reported-by: Vince Weaver <[email protected]>
Tested-by: Josh Poimboeuf <[email protected]>
Tested-by: Prashant Bhole <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/events/intel/core.c
arch/x86/events/intel/ds.c
include/linux/perf_event.h
include/uapi/linux/perf_event.h
kernel/events/core.c
This page took 0.065066 seconds and 4 git commands to generate.