perf, x86: Don't enable leaking events workaround on Broadwell
Subsystems (2)
PATCH 1/1 perf, x86: Don't enable leaking events workaround on Broadwell
From: Andi Kleen <[email protected]>
Broadwell was previously sharing the PEBS constraint table with Haswell. But recently a workaround for leaking events was added to the Haswell table. Broadwell doesn't need this workaround. So give Broadwell its own PEBS constraint table, that is identical to Haswell without exclusion workarounds. This way Broadwell doesn't enable the event exclusion unnecessarily.
Signed-off-by Andi Kleen <[email protected]>
--- arch/x86/kernel/cpu/perf_event.h | 2 ++ arch/x86/kernel/cpu/perf_event_intel.c | 2 +- arch/x86/kernel/cpu/perf_event_intel_ds.c | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event.h +2 -0
@@ -850,6 +850,8 @@ extern struct event_constraint intel_ivb_pebs_event_constraints[];extern struct event_constraint intel_hsw_pebs_event_constraints[]; +extern struct event_constraint intel_bdw_pebs_event_constraints[]; +struct event_constraint *intel_pebs_constraints (struct perf_event *event);void intel_pmu_pebs_enable (struct perf_event *event);
arch/x86/kernel/cpu/perf_event_intel.c +1 -1
@@ -3278,7 +3278,7 @@ __init int intel_pmu_init(void)intel_pmu_lbr_init_snb (); x86_pmu.event_constraints = intel_bdw_event_constraints; - x86_pmu.pebs_constraints = intel_hsw_pebs_event_constraints; + x86_pmu.pebs_constraints = intel_bdw_pebs_event_constraints; x86_pmu.extra_regs = intel_snbep_extra_regs; x86_pmu.pebs_aliases = intel_pebs_aliases_snb;/* all extra regs are per-cpu when HT is on */
arch/x86/kernel/cpu/perf_event_intel_ds.c +22 -0
@@ -657,6 +657,28 @@ struct event_constraint intel_hsw_pebs_event_constraints[] = {EVENT_CONSTRAINT_END }; +struct event_constraint intel_bdw_pebs_event_constraints[] = { +INTEL_FLAGS_UEVENT_CONSTRAINT (0x01c0 ,0x2 ),/* INST_RETIRED.PRECDIST */ +INTEL_PLD_CONSTRAINT (0x01cd ,0xf ),/* MEM_TRANS_RETIRED.* */ +/* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */ +INTEL_FLAGS_EVENT_CONSTRAINT (0x108001c2 ,0xf ), +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_NA (0x01c2 ,0xf ),/* UOPS_RETIRED.ALL */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x11d0 ,0xf ),/* MEM_UOPS_RETIRED.STLB_MISS_LOADS */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x21d0 ,0xf ),/* MEM_UOPS_RETIRED.LOCK_LOADS */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x41d0 ,0xf ),/* MEM_UOPS_RETIRED.SPLIT_LOADS */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x81d0 ,0xf ),/* MEM_UOPS_RETIRED.ALL_LOADS */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x12d0 ,0xf ),/* MEM_UOPS_RETIRED.STLB_MISS_STORES */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x42d0 ,0xf ),/* MEM_UOPS_RETIRED.SPLIT_STORES */ +INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x82d0 ,0xf ),/* MEM_UOPS_RETIRED.ALL_STORES */ +INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD (0xd1 ,0xf ),/* MEM_LOAD_UOPS_RETIRED.* */ +INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD (0xd2 ,0xf ),/* MEM_LOAD_UOPS_L3_HIT_RETIRED.* */ +INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD (0xd3 ,0xf ),/* MEM_LOAD_UOPS_L3_MISS_RETIRED.* */ +/* Allow all events as PEBS with no flags */ +INTEL_ALL_EVENT_CONSTRAINT (0 ,0xf ), +EVENT_CONSTRAINT_END +}; + +struct event_constraint *intel_pebs_constraints (struct perf_event *event) {struct event_constraint *c;
Signature · 1 line
1.9.3