]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86: Fix LBR call stack save/restore
authorAndi Kleen <ak@linux.intel.com>
Tue, 20 Oct 2015 18:46:33 +0000 (11:46 -0700)
committerIngo Molnar <mingo@kernel.org>
Mon, 23 Nov 2015 08:44:57 +0000 (09:44 +0100)
commitad66cf46f4239d0d06884eb50faefa333a18416b
tree44d175d2ef3b8a3a596d93510f8f31db4d3cd5e6
parentfeee2f6aaa55873858a66ea294e07dd9ae60a026
perf/x86: Fix LBR call stack save/restore

This fixes a bug I added in the following commit:

  955ae69be18a ("perf/x86/intel/lbr: Limit LBR accesses to TOS in callstack mode")

The bug could lead to lost LBR call stacks. When restoring the LBR state
we need to use the TOS of the previous context, not the current context.
To do that we need to save/restore the TOS.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: acme@kernel.org
Cc: jolsa@kernel.org
Link: http://lkml.kernel.org/r/1445366797-30894-1-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event.h
arch/x86/kernel/cpu/perf_event_intel_lbr.c