perf/x86/intel/uncore: Introduce UPI topology type
authorAlexander Antonov <alexander.antonov@linux.intel.com>
Thu, 17 Nov 2022 12:28:24 +0000 (12:28 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 24 Nov 2022 10:09:20 +0000 (11:09 +0100)
This patch introduces new 'uncore_upi_topology' topology type to support
UPI topology discovery.

Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Link: https://lore.kernel.org/r/20221117122833.3103580-3-alexander.antonov@linux.intel.com
arch/x86/events/intel/uncore.h
arch/x86/events/intel/uncore_snbep.c

index 917cff1e7815ed39a42ed768ec70f0d9a2a5c5ac..ef141495762389ea4d0f49c70bbf12f31e864d51 100644 (file)
@@ -183,11 +183,18 @@ struct uncore_iio_topology {
        int segment;
 };
 
+struct uncore_upi_topology {
+       int die_to;
+       int pmu_idx_to;
+       int enabled;
+};
+
 struct intel_uncore_topology {
        int pmu_idx;
        union {
                void *untyped;
                struct uncore_iio_topology *iio;
+               struct uncore_upi_topology *upi;
        };
 };
 
index 469ff889ea08d234c3be3cf14d1bde74ff778e34..d3323f13c30426ac0add93bbc80d4f10a8f2f566 100644 (file)
@@ -3774,11 +3774,13 @@ static int die_to_cpu(int die)
 
 enum {
        IIO_TOPOLOGY_TYPE,
+       UPI_TOPOLOGY_TYPE,
        TOPOLOGY_MAX
 };
 
 static const size_t topology_size[TOPOLOGY_MAX] = {
-       sizeof(*((struct intel_uncore_topology *)NULL)->iio)
+       sizeof(*((struct intel_uncore_topology *)NULL)->iio),
+       sizeof(*((struct intel_uncore_topology *)NULL)->upi)
 };
 
 static int pmu_alloc_topology(struct intel_uncore_type *type, int topology_type)