summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu/intel.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2024-11-06 08:13:03 -0800
committerAndrii Nakryiko <andrii@kernel.org>2024-11-06 08:13:03 -0800
commit5f67329cb29cf036c04c6eebdb929b20abf22c7c (patch)
tree0326d5113b951346cff38d62bf7c34c6aefea07b /arch/x86/kernel/cpu/intel.c
parent1850ce1bddf2e0939651ce1c110bc52c796e0f66 (diff)
parentdd1a7567784e2b1f80258be04f57bcfa82c997eb (diff)
Merge tag 'perf-core-for-bpf-next' from tip tree
Stable tag for bpf-next's uprobe work. Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/intel.c')
-rw-r--r--arch/x86/kernel/cpu/intel.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index e7656cbef68d..624397e43ac6 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -1299,3 +1299,18 @@ u8 get_this_hybrid_cpu_type(void)
return cpuid_eax(0x0000001a) >> X86_HYBRID_CPU_TYPE_ID_SHIFT;
}
+
+/**
+ * get_this_hybrid_cpu_native_id() - Get the native id of this hybrid CPU
+ *
+ * Returns the uarch native ID [23:0] of a CPU in a hybrid processor.
+ * If the processor is not hybrid, returns 0.
+ */
+u32 get_this_hybrid_cpu_native_id(void)
+{
+ if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
+ return 0;
+
+ return cpuid_eax(0x0000001a) &
+ (BIT_ULL(X86_HYBRID_CPU_TYPE_ID_SHIFT) - 1);
+}