summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2020-03-17 21:38:32 +0300
committerPeter Zijlstra <peterz@infradead.org>2020-03-20 15:06:23 +0300
commitbc88a2fe216a51e8ab46d61f89d0c1b5a400470e (patch)
tree2fffe825b7838a6b4721faa8eb6fea3b516fb41d
parenta6763625ae6f8aa5ee82fcd8fa4e5e38db20dbc6 (diff)
downloadlinux-bc88a2fe216a51e8ab46d61f89d0c1b5a400470e.tar.xz
perf/x86/intel/uncore: Add box_offsets for free-running counters
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: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/1584470314-46657-1-git-send-email-kan.liang@linux.intel.com
-rw-r--r--arch/x86/events/intel/uncore.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index 1204dcc9fe9b..b30429f8a53a 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -154,6 +154,7 @@ struct freerunning_counters {
unsigned int box_offset;
unsigned int num_counters;
unsigned int bits;
+ unsigned *box_offsets;
};
struct pci2phy_map {
@@ -310,7 +311,9 @@ unsigned int uncore_freerunning_counter(struct intel_uncore_box *box,
return pmu->type->freerunning[type].counter_base +
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