aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_ds.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 0e3a9c73187d..cd1993e46d19 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -1230,6 +1230,18 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
1230 pebs_status = p->status & cpuc->pebs_enabled; 1230 pebs_status = p->status & cpuc->pebs_enabled;
1231 pebs_status &= (1ULL << x86_pmu.max_pebs_events) - 1; 1231 pebs_status &= (1ULL << x86_pmu.max_pebs_events) - 1;
1232 1232
1233 /*
1234 * On some CPUs the PEBS status can be zero when PEBS is
1235 * racing with clearing of GLOBAL_STATUS.
1236 *
1237 * Normally we would drop that record, but in the
1238 * case when there is only a single active PEBS event
1239 * we can assume it's for that event.
1240 */
1241 if (!pebs_status && cpuc->pebs_enabled &&
1242 !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1)))
1243 pebs_status = cpuc->pebs_enabled;
1244
1233 bit = find_first_bit((unsigned long *)&pebs_status, 1245 bit = find_first_bit((unsigned long *)&pebs_status,
1234 x86_pmu.max_pebs_events); 1246 x86_pmu.max_pebs_events);
1235 if (bit >= x86_pmu.max_pebs_events) 1247 if (bit >= x86_pmu.max_pebs_events)