Skip to contentSkip to conversation

perf,x86: Fix Userspace RDPMC switch

PATCH New Peter Zijlstra 1 participant 1 message Feb 5, 2014

Subsystems (2)
lore
Share & tools
lore

Peter Zijlstra

author maintainer
#0 lore raw

PATCH 1/1 perf,x86: Fix Userspace RDPMC switch

Subject: perf,x86: Fix Userspace RDPMC switch
From: Peter Zijlstra <[email protected]>
Date: Wed Feb 5 11:19:56 CET 2014

The current code forgets to change the CR4 state on the current CPU. User on_each_cpu() instead of smp_call_function().

---
 arch/x86/kernel/cpu/perf_event.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event.c +1 -1
@@ -1826,7 +1826,7 @@ static ssize_t set_attr_rdpmc(struct dev
 
 	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;