perf/x86/intel/uncore: Enable IIO stacks to PMON mapping for multi-segment SKX
Subsystems (2)
PATCH 1/1 perf/x86/intel/uncore: Enable IIO stacks to PMON mapping for multi-segment SKX
IIO stacks to PMON mapping on Skylake servers is exposed through introduced early attributes /sys/devices/uncore_iio_<pmu_idx>/dieX, where dieX is a file which holds "Segment:Root Bus" for PCIe root port which can be monitored by that IIO PMON block. These sysfs attributes are disabled for multiple segment topologies except VMD domains which start at 0x10000. This patch removes the limitation and enables IIO stacks to PMON mapping for multi-segment Skylake servers by introducing segment-aware intel_uncore_topology structure and attributing the topology configuration to the segment in skx_iio_get_topology() function.
--- arch/x86/events/intel/uncore.c | 12 ++++++ arch/x86/events/intel/uncore.h | 9 ++++- arch/x86/events/intel/uncore_snbep.c | 60 +++++++++++++--------------- 3 files changed, 47 insertions(+), 34 deletions(-)
arch/x86/events/intel/uncore.c +12 -0
@@ -48,6 +48,18 @@ int uncore_pcibus_to_dieid(struct pci_bus *bus)return die_id; } +int uncore_die_to_segment (int die) +{ +struct pci_bus *bus =NULL ; + +/* Find first pci bus which attributes to specified die. */ +while ((bus =pci_find_next_bus (bus)) && + (die !=uncore_pcibus_to_dieid (bus))) + ; + +return bus ?pci_domain_nr (bus) : -EINVAL ; +} +static void uncore_free_pcibus_map (void ) {struct pci2phy_map *map, *tmp;
arch/x86/events/intel/uncore.h +8 -1
@@ -42,6 +42,7 @@ struct intel_uncore_pmu;struct intel_uncore_box ;struct uncore_event_desc ;struct freerunning_counters ; +struct intel_uncore_topology ;struct intel_uncore_type {const char *name;
@@ -80,7 +81,7 @@ struct intel_uncore_type {* to identify which platform component each PMON block of that type is * supposed to monitor. */ -u64 *topology; +struct intel_uncore_topology *topology;/* * Optional callbacks for managing mapping of Uncore units to PMONs */
@@ -169,6 +170,11 @@ struct freerunning_counters {unsigned *box_offsets; }; +struct intel_uncore_topology { +u64 configuration; +int segment; +}; +struct pci2phy_map {struct list_head list;int segment;
@@ -177,6 +183,7 @@ struct pci2phy_map {struct pci2phy_map *__find_pci2phy_map (int segment);int uncore_pcibus_to_dieid (struct pci_bus *bus); +int uncore_die_to_segment (int die);ssize_t uncore_event_show (struct device *dev,struct device_attribute *attr,char *buf);
arch/x86/events/intel/uncore_snbep.c +27 -33
94 lines not on this page · raw message
Signature · 1 line
2.19.1
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: cface0326a6c2ae5c8f47bd466f07624b3e348a7 Gitweb: https://git.kernel.org/tip/cface0326a6c2ae5c8f47bd466f07624b3e348a7 Author: Alexander Antonov <[email protected]> AuthorDate: Tue, 23 Mar 2021 18:05:07 +03:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Fri, 02 Apr 2021 10:04:55 +02:00
perf/x86/intel/uncore: Enable IIO stacks to PMON mapping for multi-segment SKX
IIO stacks to PMON mapping on Skylake servers is exposed through introduced early attributes /sys/devices/uncore_iio_<pmu_idx>/dieX, where dieX is a file which holds "Segment:Root Bus" for PCIe root port which can be monitored by that IIO PMON block. These sysfs attributes are disabled for multiple segment topologies except VMD domains which start at 0x10000. This patch removes the limitation and enables IIO stacks to PMON mapping for multi-segment Skylake servers by introducing segment-aware intel_uncore_topology structure and attributing the topology configuration to the segment in skx_iio_get_topology() function.
--- arch/x86/events/intel/uncore.c | 12 +++++- arch/x86/events/intel/uncore.h | 9 +++- arch/x86/events/intel/uncore_snbep.c | 60 ++++++++++++--------------- 3 files changed, 47 insertions(+), 34 deletions(-)
arch/x86/events/intel/uncore.c +12 -0
@@ -53,6 +53,18 @@ int uncore_pcibus_to_dieid(struct pci_bus *bus)return die_id; } +int uncore_die_to_segment (int die) +{ +struct pci_bus *bus =NULL ; + +/* Find first pci bus which attributes to specified die. */ +while ((bus =pci_find_next_bus (bus)) && + (die !=uncore_pcibus_to_dieid (bus))) + ; + +return bus ?pci_domain_nr (bus) : -EINVAL ; +} +static void uncore_free_pcibus_map (void ) {struct pci2phy_map *map, *tmp;
arch/x86/events/intel/uncore.h +8 -1
@@ -42,6 +42,7 @@ struct intel_uncore_pmu;struct intel_uncore_box ;struct uncore_event_desc ;struct freerunning_counters ; +struct intel_uncore_topology ;struct intel_uncore_type {const char *name;
@@ -87,7 +88,7 @@ struct intel_uncore_type {* to identify which platform component each PMON block of that type is * supposed to monitor. */ -u64 *topology; +struct intel_uncore_topology *topology;/* * Optional callbacks for managing mapping of Uncore units to PMONs */
@@ -176,6 +177,11 @@ struct freerunning_counters {unsigned *box_offsets; }; +struct intel_uncore_topology { +u64 configuration; +int segment; +}; +struct pci2phy_map {struct list_head list;int segment;
@@ -184,6 +190,7 @@ struct pci2phy_map {struct pci2phy_map *__find_pci2phy_map (int segment);int uncore_pcibus_to_dieid (struct pci_bus *bus); +int uncore_die_to_segment (int die);ssize_t uncore_event_show (struct device *dev,struct device_attribute *attr,char *buf);
arch/x86/events/intel/uncore_snbep.c +27 -33
94 lines not on this page · raw message