summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_event.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2012-06-05 15:30:31 +0200
committerIngo Molnar <mingo@kernel.org>2012-06-06 16:59:44 +0200
commitb430f7c4706aeba4270c7ab7744fc504b9315e1c (patch)
treeca92a63aa1499981c30fccb63db1270596af2aad /arch/x86/kernel/cpu/perf_event.c
parent436d03faf6961b30e13b2d0967aea9d772d6cf44 (diff)
downloadop-kernel-dev-b430f7c4706aeba4270c7ab7744fc504b9315e1c.zip
op-kernel-dev-b430f7c4706aeba4270c7ab7744fc504b9315e1c.tar.gz
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>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.c')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index e049d6d..cb60838 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1496,6 +1496,7 @@ static struct cpu_hw_events *allocate_fake_cpuc(void)
if (!cpuc->shared_regs)
goto error;
}
+ cpuc->is_fake = 1;
return cpuc;
error:
free_fake_cpuc(cpuc);
OpenPOWER on IntegriCloud