aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2015-02-27 12:48:30 -0500
committerIngo Molnar <mingo@kernel.org>2015-04-02 11:33:16 -0400
commit8882edf735738c949aba4b65d3ec3453066bab12 (patch)
tree03672541d9447ef25d53e568cba669dfb2e94ad8
parentb37609c30e41264c4df4acff78abfc894499a49b (diff)
perf/x86/intel: Reset more state in PMU reset
The PMU reset code didn't quite keep up with newer PMU features. Improve it a bit to really reset a modern PMU: - Clear all overflow status - Clear LBRs and freezing state - Disable fixed counters too Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: eranian@google.com Link: http://lkml.kernel.org/r/1425059312-18217-2-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 6ea61a572fb0..59994602bb94 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -1538,6 +1538,18 @@ static void intel_pmu_reset(void)
1538 if (ds) 1538 if (ds)
1539 ds->bts_index = ds->bts_buffer_base; 1539 ds->bts_index = ds->bts_buffer_base;
1540 1540
1541 /* Ack all overflows and disable fixed counters */
1542 if (x86_pmu.version >= 2) {
1543 intel_pmu_ack_status(intel_pmu_get_status());
1544 wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0);
1545 }
1546
1547 /* Reset LBRs and LBR freezing */
1548 if (x86_pmu.lbr_nr) {
1549 update_debugctlmsr(get_debugctlmsr() &
1550 ~(DEBUGCTLMSR_FREEZE_LBRS_ON_PMI|DEBUGCTLMSR_LBR));
1551 }
1552
1541 local_irq_restore(flags); 1553 local_irq_restore(flags);
1542} 1554}
1543 1555