From e4b444347795a1ecc083895582bc2e7f288a22e4 Mon Sep 17 00:00:00 2001 From: K Prateek Nayak Date: Fri, 15 Nov 2024 06:07:58 +0000 Subject: x86/topology: Introduce topology_logical_core_id() On x86, topology_core_id() returns a unique core ID within the PKG domain. Looking at match_smt() suggests that a core ID just needs to be unique within a LLC domain. For use cases such as the core RAPL PMU, there exists a need for a unique core ID across the entire system with multiple PKG domains. Introduce topology_logical_core_id() to derive a unique core ID across the system. Signed-off-by: K Prateek Nayak Signed-off-by: Dhananjay Ugwekar Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Zhang Rui Reviewed-by: "Gautham R. Shenoy" Tested-by: K Prateek Nayak Tested-by: Oleksandr Natalenko Link: https://lore.kernel.org/r/20241115060805.447565-3-Dhananjay.Ugwekar@amd.com --- arch/x86/include/asm/processor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/x86/include/asm/processor.h') diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index c0975815980c..cfd8a5591421 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -98,6 +98,7 @@ struct cpuinfo_topology { // Logical ID mappings u32 logical_pkg_id; u32 logical_die_id; + u32 logical_core_id; // AMD Node ID and Nodes per Package info u32 amd_node_id; -- cgit v1.2.3