arch/x86/events/amd/uncore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
For DF and UMC PMUs, a single context is shared across all CPUs that are
connected to the same Data Fabric (DF) instance. Currently, Socket ID is
used to identify DF instances. This approach works for configurations
having a single IO Die (IOD) but fails in the following cases.
* Older Zen 1 processors, where each chiplet has its own DF instance
instead of a single IOD.
* Any configurations with multiple IODs in a single socket.
Address this by using the Node ID available in ECX[7:0] of CPUID leaf
0x8000001e which is already provided by topology_amd_node_id(). Replace
the use of topology_logical_package_id() with topology_amd_node_id() in
order to correctly identify domains for context sharing.
Fixes: 07888daa056e ("perf/x86/amd/uncore: Move discovery and registration")
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
---
arch/x86/events/amd/uncore.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index 9293ce50574d..9a13a9f21d2f 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -700,7 +700,7 @@ void amd_uncore_df_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
info.split.aux_data = 0;
info.split.num_pmcs = NUM_COUNTERS_NB;
info.split.gid = 0;
- info.split.cid = topology_logical_package_id(cpu);
+ info.split.cid = topology_amd_node_id(cpu);
if (pmu_version >= 2) {
ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
@@ -999,8 +999,8 @@ void amd_uncore_umc_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
cpuid(EXT_PERFMON_DEBUG_FEATURES, &eax, &ebx.full, &ecx, &edx);
info.split.aux_data = ecx; /* stash active mask */
info.split.num_pmcs = ebx.split.num_umc_pmc;
- info.split.gid = topology_logical_package_id(cpu);
- info.split.cid = topology_logical_package_id(cpu);
+ info.split.gid = topology_amd_node_id(cpu);
+ info.split.cid = topology_amd_node_id(cpu);
*per_cpu_ptr(uncore->info, cpu) = info;
}
--
2.43.0
On Thu, Jan 22, 2026 at 12:15:05PM +0530, Sandipan Das wrote:
> For DF and UMC PMUs, a single context is shared across all CPUs that are
> connected to the same Data Fabric (DF) instance. Currently, Socket ID is
> used to identify DF instances. This approach works for configurations
> having a single IO Die (IOD) but fails in the following cases.
> * Older Zen 1 processors, where each chiplet has its own DF instance
> instead of a single IOD.
> * Any configurations with multiple IODs in a single socket.
>
> Address this by using the Node ID available in ECX[7:0] of CPUID leaf
> 0x8000001e which is already provided by topology_amd_node_id(). Replace
> the use of topology_logical_package_id() with topology_amd_node_id() in
> order to correctly identify domains for context sharing.
>
> Fixes: 07888daa056e ("perf/x86/amd/uncore: Move discovery and registration")
> Signed-off-by: Sandipan Das <sandipan.das@amd.com>
> ---
> arch/x86/events/amd/uncore.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
> index 9293ce50574d..9a13a9f21d2f 100644
> --- a/arch/x86/events/amd/uncore.c
> +++ b/arch/x86/events/amd/uncore.c
> @@ -700,7 +700,7 @@ void amd_uncore_df_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
> info.split.aux_data = 0;
> info.split.num_pmcs = NUM_COUNTERS_NB;
> info.split.gid = 0;
> - info.split.cid = topology_logical_package_id(cpu);
> + info.split.cid = topology_amd_node_id(cpu);
>
> if (pmu_version >= 2) {
> ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
> @@ -999,8 +999,8 @@ void amd_uncore_umc_ctx_scan(struct amd_uncore *uncore, unsigned int cpu)
> cpuid(EXT_PERFMON_DEBUG_FEATURES, &eax, &ebx.full, &ecx, &edx);
> info.split.aux_data = ecx; /* stash active mask */
> info.split.num_pmcs = ebx.split.num_umc_pmc;
> - info.split.gid = topology_logical_package_id(cpu);
> - info.split.cid = topology_logical_package_id(cpu);
> + info.split.gid = topology_amd_node_id(cpu);
> + info.split.cid = topology_amd_node_id(cpu);
> *per_cpu_ptr(uncore->info, cpu) = info;
> }
>
> --
> 2.43.0
>
>
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
© 2016 - 2026 Red Hat, Inc.