|
@@ -1244,7 +1244,10 @@ static __initconst const u64 slm_hw_cache_event_ids
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
-static void intel_pmu_disable_all(void)
|
|
|
|
|
|
+/*
|
|
|
|
+ * Use from PMIs where the LBRs are already disabled.
|
|
|
|
+ */
|
|
|
|
+static void __intel_pmu_disable_all(void)
|
|
{
|
|
{
|
|
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
|
|
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
@@ -1256,15 +1259,20 @@ static void intel_pmu_disable_all(void)
|
|
intel_bts_disable_local();
|
|
intel_bts_disable_local();
|
|
|
|
|
|
intel_pmu_pebs_disable_all();
|
|
intel_pmu_pebs_disable_all();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void intel_pmu_disable_all(void)
|
|
|
|
+{
|
|
|
|
+ __intel_pmu_disable_all();
|
|
intel_pmu_lbr_disable_all();
|
|
intel_pmu_lbr_disable_all();
|
|
}
|
|
}
|
|
|
|
|
|
-static void intel_pmu_enable_all(int added)
|
|
|
|
|
|
+static void __intel_pmu_enable_all(int added, bool pmi)
|
|
{
|
|
{
|
|
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
|
|
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
|
|
|
|
|
|
intel_pmu_pebs_enable_all();
|
|
intel_pmu_pebs_enable_all();
|
|
- intel_pmu_lbr_enable_all();
|
|
|
|
|
|
+ intel_pmu_lbr_enable_all(pmi);
|
|
wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL,
|
|
wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL,
|
|
x86_pmu.intel_ctrl & ~cpuc->intel_ctrl_guest_mask);
|
|
x86_pmu.intel_ctrl & ~cpuc->intel_ctrl_guest_mask);
|
|
|
|
|
|
@@ -1280,6 +1288,11 @@ static void intel_pmu_enable_all(int added)
|
|
intel_bts_enable_local();
|
|
intel_bts_enable_local();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void intel_pmu_enable_all(int added)
|
|
|
|
+{
|
|
|
|
+ __intel_pmu_enable_all(added, false);
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Workaround for:
|
|
* Workaround for:
|
|
* Intel Errata AAK100 (model 26)
|
|
* Intel Errata AAK100 (model 26)
|
|
@@ -1573,7 +1586,7 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
|
|
*/
|
|
*/
|
|
if (!x86_pmu.late_ack)
|
|
if (!x86_pmu.late_ack)
|
|
apic_write(APIC_LVTPC, APIC_DM_NMI);
|
|
apic_write(APIC_LVTPC, APIC_DM_NMI);
|
|
- intel_pmu_disable_all();
|
|
|
|
|
|
+ __intel_pmu_disable_all();
|
|
handled = intel_pmu_drain_bts_buffer();
|
|
handled = intel_pmu_drain_bts_buffer();
|
|
handled += intel_bts_interrupt();
|
|
handled += intel_bts_interrupt();
|
|
status = intel_pmu_get_status();
|
|
status = intel_pmu_get_status();
|
|
@@ -1658,7 +1671,7 @@ again:
|
|
goto again;
|
|
goto again;
|
|
|
|
|
|
done:
|
|
done:
|
|
- intel_pmu_enable_all(0);
|
|
|
|
|
|
+ __intel_pmu_enable_all(0, true);
|
|
/*
|
|
/*
|
|
* Only unmask the NMI after the overflow counters
|
|
* Only unmask the NMI after the overflow counters
|
|
* have been reset. This avoids spurious NMIs on
|
|
* have been reset. This avoids spurious NMIs on
|