perf/x86/uncore: Apply the unit control RB tree to PCI uncore units
authorKan Liang <kan.liang@linux.intel.com>
Fri, 14 Jun 2024 13:46:29 +0000 (06:46 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Jun 2024 15:57:58 +0000 (17:57 +0200)
commitf76a8420444beb1c3968504c8176a67d2d5fe18f
treed48dc01e96f2d091bdb96e96388e3d155a5fa372
parentb1d9ea2e1ca44987c8409cc628dfb0c84e93dce9
perf/x86/uncore: Apply the unit control RB tree to PCI uncore units

The unit control RB tree has the unit control and unit ID information
for all the PCI units. Use them to replace the box_ctls/pci_offsets to
get an accurate unit control address for PCI uncore units.

The UPI/M3UPI units in the discovery table are ignored. Please see the
commit 65248a9a9ee1 ("perf/x86/uncore: Add a quirk for UPI on SPR").
Manually allocate a unit control RB tree for UPI/M3UPI.
Add cleanup_extra_boxes to release such manual allocation.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Yunying Sun <yunying.sun@intel.com>
Link: https://lore.kernel.org/r/20240614134631.1092359-7-kan.liang@linux.intel.com
arch/x86/events/intel/uncore.c
arch/x86/events/intel/uncore.h
arch/x86/events/intel/uncore_discovery.c
arch/x86/events/intel/uncore_discovery.h
arch/x86/events/intel/uncore_snbep.c