perf/x86: Fix Intel shared extra MSR allocation
authorPeter Zijlstra <peterz@infradead.org>
Tue, 5 Jun 2012 13:30:31 +0000 (15:30 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 6 Jun 2012 14:59:44 +0000 (16:59 +0200)
commitb430f7c4706aeba4270c7ab7744fc504b9315e1c
treeca92a63aa1499981c30fccb63db1270596af2aad
parent436d03faf6961b30e13b2d0967aea9d772d6cf44
perf/x86: Fix Intel shared extra MSR allocation

Zheng Yan reported that event group validation can wreck event state
when Intel extra_reg allocation changes event state.

Validation shouldn't change any persistent state. Cloning events in
validate_{event,group}() isn't really pretty either, so add a few
special cases to avoid modifying the event state.

The code is restructured to minimize the special case impact.

Reported-by: Zheng Yan <zheng.z.yan@linux.intel.com>
Acked-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1338903031.28282.175.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event.h
arch/x86/kernel/cpu/perf_event_intel.c