perf/x86: Fix Userspace RDPMC switch
authorPeter Zijlstra <peterz@infradead.org>
Wed, 5 Feb 2014 10:19:56 +0000 (11:19 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 9 Feb 2014 12:08:25 +0000 (13:08 +0100)
The current code forgets to change the CR4 state on the current CPU.
Use on_each_cpu() instead of smp_call_function().

Reported-by: Mark Davies <junk@eslaf.co.uk>
Suggested-by: Mark Davies <junk@eslaf.co.uk>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: fweisbec@gmail.com
Link: http://lkml.kernel.org/n/tip-69efsat90ibhnd577zy3z9gh@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event.c

index 1246b853c4e02cb8e27e4b844d167bea24989b2f..895604f2e91634ebb976142dcb40e345a804ed69 100644 (file)
@@ -1826,7 +1826,7 @@ static ssize_t set_attr_rdpmc(struct device *cdev,
 
        if (!!val != !!x86_pmu.attr_rdpmc) {
                x86_pmu.attr_rdpmc = !!val;
-               smp_call_function(change_rdpmc, (void *)val, 1);
+               on_each_cpu(change_rdpmc, (void *)val, 1);
        }
 
        return count;