aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorVince Weaver <vincent.weaver@maine.edu>2012-10-17 13:04:33 -0400
committerIngo Molnar <mingo@kernel.org>2012-10-24 06:00:49 -0400
commit7d011962afbaa6e572cd8e0dbb7abf773e166e64 (patch)
tree67da56cc0572462dc0d0c27933c0e80348d0ca92 /arch/x86/kernel
parentae5ba47a990a18c869d66916fd72fb334c45cf91 (diff)
perf/x86: Remove cpuc->enable check on Intl KNC event enable/disable
x86_pmu.enable() is called from x86_pmu_enable() with cpuc->enabled set to 0. This means we weren't re-enabling the counters after a context switch. This patch just removes the check, as it should't be necessary (and the equivelent x86_ generic code does not have the checks). The origin of this problem is the KNC driver being based on the P6 one. The P6 driver also has this issue, but works anyway due to various lucky accidents. Signed-off-by: Vince Weaver <vincent.weaver@maine.edu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: eranian@gmail.com Cc: Meadows Cc: Lawrence F <lawrence.f.meadows@intel.com> Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1210171303290.23243@vincent-weaver-1.um.maine.edu Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/cpu/perf_event_knc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_knc.c b/arch/x86/kernel/cpu/perf_event_knc.c
index 73bcfbdedd50..f3a2af41552d 100644
--- a/arch/x86/kernel/cpu/perf_event_knc.c
+++ b/arch/x86/kernel/cpu/perf_event_knc.c
@@ -173,26 +173,22 @@ static void knc_pmu_enable_all(int added)
173static inline void 173static inline void
174knc_pmu_disable_event(struct perf_event *event) 174knc_pmu_disable_event(struct perf_event *event)
175{ 175{
176 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
177 struct hw_perf_event *hwc = &event->hw; 176 struct hw_perf_event *hwc = &event->hw;
178 u64 val; 177 u64 val;
179 178
180 val = hwc->config; 179 val = hwc->config;
181 if (cpuc->enabled) 180 val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
182 val &= ~ARCH_PERFMON_EVENTSEL_ENABLE;
183 181
184 (void)wrmsrl_safe(hwc->config_base + hwc->idx, val); 182 (void)wrmsrl_safe(hwc->config_base + hwc->idx, val);
185} 183}
186 184
187static void knc_pmu_enable_event(struct perf_event *event) 185static void knc_pmu_enable_event(struct perf_event *event)
188{ 186{
189 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
190 struct hw_perf_event *hwc = &event->hw; 187 struct hw_perf_event *hwc = &event->hw;
191 u64 val; 188 u64 val;
192 189
193 val = hwc->config; 190 val = hwc->config;
194 if (cpuc->enabled) 191 val |= ARCH_PERFMON_EVENTSEL_ENABLE;
195 val |= ARCH_PERFMON_EVENTSEL_ENABLE;
196 192
197 (void)wrmsrl_safe(hwc->config_base + hwc->idx, val); 193 (void)wrmsrl_safe(hwc->config_base + hwc->idx, val);
198} 194}