提交 4b559ab4 编写于 作者: K Kan Liang 提交者: Caspar Zhang

Intel: perf/x86/intel/uncore: Add box_offsets for free-running counters

fix #29130534

commit bc88a2fe216a51e8ab46d61f89d0c1b5a400470e upstream.

Backport summary: Backport to kernel 4.19.57 for ICX uncore support.

The offset between uncore boxes of free-running counters varies, e.g.
IIO free-running counters on Ice Lake server.

Add box_offsets, an array of offsets between adjacent uncore boxes.
Signed-off-by: NKan Liang <kan.liang@linux.intel.com>
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1584470314-46657-1-git-send-email-kan.liang@linux.intel.comSigned-off-by: NYunying Sun <yunying.sun@intel.com>
Signed-off-by: NPeng Wang <rocking@linux.alibaba.com>
Reviewed-by: NArtie Ding <artie.ding@linux.alibaba.com>
上级 6b7f290f
...@@ -147,6 +147,7 @@ struct freerunning_counters { ...@@ -147,6 +147,7 @@ struct freerunning_counters {
unsigned int box_offset; unsigned int box_offset;
unsigned int num_counters; unsigned int num_counters;
unsigned int bits; unsigned int bits;
unsigned *box_offsets;
}; };
struct pci2phy_map { struct pci2phy_map {
...@@ -303,7 +304,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box, ...@@ -303,7 +304,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box,
return pmu->type->freerunning[type].counter_base + return pmu->type->freerunning[type].counter_base +
pmu->type->freerunning[type].counter_offset * idx + pmu->type->freerunning[type].counter_offset * idx +
pmu->type->freerunning[type].box_offset * pmu->pmu_idx; (pmu->type->freerunning[type].box_offsets ?
pmu->type->freerunning[type].box_offsets[pmu->pmu_idx] :
pmu->type->freerunning[type].box_offset * pmu->pmu_idx);
} }
static inline static inline
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册