]> 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)
commitede72400c1d5756dcef04004719bef181b3691bd
tree44d175d2ef3b8a3a596d93510f8f31db4d3cd5e6
parent8a828dfaae2ef6d0958827d5eee14b1314ec94b1
perf/x86: Fix LBR call stack save/restore

This fixes a bug I added in the following commit:

  c2bdaa9d379f ("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