Skip to content

Commit 57e1199

Browse files
sandip4nPeter Zijlstra
authored andcommitted
perf/x86/amd/uncore: Fix DF and UMC domain identification
For uncore PMUs, a single context is shared across all CPUs in a domain. The domain can be a CCX, like in the case of the L3 PMU, or a socket, like in the case of DF and UMC PMUs. This information is available via the PMU's cpumask. For contexts shared across a socket, the domain is currently determined from topology_die_id() which is incorrect after the introduction of commit 63edbaa ("x86/cpu/topology: Add support for the AMD 0x80000026 leaf") as it now returns a CCX identifier on Zen 4 and later systems which support CPUID leaf 0x80000026. Use topology_logical_package_id() instead as it always returns a socket identifier irrespective of the availability of CPUID leaf 0x80000026. Fixes: 63edbaa ("x86/cpu/topology: Add support for the AMD 0x80000026 leaf") Signed-off-by: Sandipan Das <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent f997e20 commit 57e1199

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/events/amd/uncore.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ void amd_uncore_df_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
643643
info.split.aux_data = 0;
644644
info.split.num_pmcs = NUM_COUNTERS_NB;
645645
info.split.gid = 0;
646-
info.split.cid = topology_die_id(cpu);
646+
info.split.cid = topology_logical_package_id(cpu);
647647

648648
if (pmu_version >= 2) {
649649
ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
@@ -903,8 +903,8 @@ void amd_uncore_umc_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
903903
cpuid(EXT_PERFMON_DEBUG_FEATURES, &eax, &ebx.full, &ecx, &edx);
904904
info.split.aux_data = ecx; /* stash active mask */
905905
info.split.num_pmcs = ebx.split.num_umc_pmc;
906-
info.split.gid = topology_die_id(cpu);
907-
info.split.cid = topology_die_id(cpu);
906+
info.split.gid = topology_logical_package_id(cpu);
907+
info.split.cid = topology_logical_package_id(cpu);
908908
*per_cpu_ptr(uncore->info, cpu) = info;
909909
}
910910

0 commit comments

Comments
 (0)