diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2015-06-11 08:13:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-29 15:35:28 -0400 |
commit | 55c9e52cf3b056109ab84de8d2a5b4b6e0a4cefa (patch) | |
tree | f68472f73281582d17f459356f4b10e9ad3ecdb2 /arch/x86/kernel/cpu/perf_event.h | |
parent | 0432ca1ad0d399d40db32c4364143b1d741e18c5 (diff) |
perf/x86/intel/bts: Fix DS area sharing with x86_pmu events
commit 6b099d9b040b0f3d0aec05b560d7caf879af5077 upstream.
Currently, the intel_bts driver relies on the DS area allocated by the x86_pmu
code in its event_init() path, which is a bug: creating a BTS event while
no x86_pmu events are present results in a NULL pointer dereference.
The same DS area is also used by PEBS sampling, which makes it quite a bit
trickier to have a separate one for intel_bts' purposes.
This patch makes intel_bts driver use the same DS allocation and reference
counting code as x86_pmu to make sure it is always present when either
intel_bts or x86_pmu need it.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: acme@infradead.org
Cc: adrian.hunter@intel.com
Link: http://lkml.kernel.org/r/1434024837-9916-2-git-send-email-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.h')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index ef78516850fb..f068695eaca0 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
@@ -703,6 +703,10 @@ int x86_add_exclusive(unsigned int what); | |||
703 | 703 | ||
704 | void x86_del_exclusive(unsigned int what); | 704 | void x86_del_exclusive(unsigned int what); |
705 | 705 | ||
706 | int x86_reserve_hardware(void); | ||
707 | |||
708 | void x86_release_hardware(void); | ||
709 | |||
706 | void hw_perf_lbr_event_destroy(struct perf_event *event); | 710 | void hw_perf_lbr_event_destroy(struct perf_event *event); |
707 | 711 | ||
708 | int x86_setup_perfctr(struct perf_event *event); | 712 | int x86_setup_perfctr(struct perf_event *event); |