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 15:22:26 +0000 (17:22 +0200)
commit5a425294ee7d4ab5a374248e85838dfd450caf75
tree107d193d769524b6cdb405073cba0b7f39208305
parent778b032d96909690c19d84f8d17c13be65ed6f8e
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