Commit aa4b1617 authored by Kan Liang's avatar Kan Liang Committed by Yunying Sun
Browse files

perf/x86/uncore: Retrieve the unit ID from the unit control RB tree

mainline inclusion
from mainline-v6.11-rc1
commit 585463fee64270d4b4d80b1e433d2105ef555bec
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/IAGJQ7
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=585463fee64270d4b4d80b1e433d2105ef555bec



-------------------------------------

The box_ids only save the unit ID for the first die. If a unit, e.g., a
CXL unit, doesn't exist in the first die. The unit ID cannot be
retrieved.

The unit control RB tree also stores the unit ID information.
Retrieve the unit ID from the unit control RB tree

Intel-SIG: commit 585463fee642 perf/x86/uncore: Retrieve the unit ID from the unit control RB tree
Backport SPR/EMR CXL and HBM perfmon support to kernel v5.10

Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: default avatarYunying Sun <yunying.sun@intel.com>
Link: https://lore.kernel.org/r/20240614134631.1092359-4-kan.liang@linux.intel.com


Signed-off-by: default avatarYunying Sun <yunying.sun@intel.com>
parent 4118bca2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -854,6 +854,9 @@ static const struct attribute_group uncore_pmu_attr_group = {
static inline int uncore_get_box_id(struct intel_uncore_type *type,
				    struct intel_uncore_pmu *pmu)
{
	if (type->boxes)
		return intel_uncore_find_discovery_unit_id(type->boxes, -1, pmu->pmu_idx);

	return type->box_ids ? type->box_ids[pmu->pmu_idx] : pmu->pmu_idx;
}