提交 7e608cdf 编写于 作者: L Len Brown 提交者: Yang Yingliang

Intel: cpu/topology: Export die_id

mainline inclusion
from mainline-v5.3-rc1
commit 0e344d8c
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I47H3V
CVE: NA

--------------------------------

commit 0e344d8c upstream.

Export die_id in cpu topology, for the benefit of hardware that has
multiple-die/package.
Signed-off-by: NLen Brown <len.brown@intel.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Reviewed-by: NIngo Molnar <mingo@kernel.org>
Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: linux-doc@vger.kernel.org
Link: https://lkml.kernel.org/r/e7d1caaf4fbd24ee40db6d557ab28d7d83298900.1557769318.git.len.brown@intel.comSigned-off-by: NYouquan Song <youquan.song@intel.com>
Signed-off-by: NJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 780eb0a3
...@@ -12,6 +12,12 @@ physical_package_id: ...@@ -12,6 +12,12 @@ physical_package_id:
socket number, but the actual value is architecture and platform socket number, but the actual value is architecture and platform
dependent. dependent.
die_id:
the CPU die ID of cpuX. Typically it is the hardware platform's
identifier (rather than the kernel's). The actual value is
architecture and platform dependent.
core_id: core_id:
the CPU core ID of cpuX. Typically it is the hardware platform's the CPU core ID of cpuX. Typically it is the hardware platform's
...@@ -81,6 +87,7 @@ For an architecture to support this feature, it must define some of ...@@ -81,6 +87,7 @@ For an architecture to support this feature, it must define some of
these macros in include/asm-XXX/topology.h:: these macros in include/asm-XXX/topology.h::
#define topology_physical_package_id(cpu) #define topology_physical_package_id(cpu)
#define topology_die_id(cpu)
#define topology_core_id(cpu) #define topology_core_id(cpu)
#define topology_book_id(cpu) #define topology_book_id(cpu)
#define topology_drawer_id(cpu) #define topology_drawer_id(cpu)
...@@ -99,9 +106,11 @@ provides default definitions for any of the above macros that are ...@@ -99,9 +106,11 @@ provides default definitions for any of the above macros that are
not defined by include/asm-XXX/topology.h: not defined by include/asm-XXX/topology.h:
1) topology_physical_package_id: -1 1) topology_physical_package_id: -1
2) topology_core_id: 0 2) topology_die_id: -1
3) topology_sibling_cpumask: just the given CPU 3) topology_core_id: 0
4) topology_core_cpumask: just the given CPU 4) topology_sibling_cpumask: just the given CPU
5) topology_core_cpumask: just the given CPU
6) topology_die_cpumask: just the given CPU
For architectures that don't support books (CONFIG_SCHED_BOOK) there are no For architectures that don't support books (CONFIG_SCHED_BOOK) there are no
default definitions for topology_book_id() and topology_book_cpumask(). default definitions for topology_book_id() and topology_book_cpumask().
......
...@@ -43,6 +43,9 @@ static ssize_t name##_list_show(struct device *dev, \ ...@@ -43,6 +43,9 @@ static ssize_t name##_list_show(struct device *dev, \
define_id_show_func(physical_package_id); define_id_show_func(physical_package_id);
static DEVICE_ATTR_RO(physical_package_id); static DEVICE_ATTR_RO(physical_package_id);
define_id_show_func(die_id);
static DEVICE_ATTR_RO(die_id);
define_id_show_func(core_id); define_id_show_func(core_id);
static DEVICE_ATTR_RO(core_id); static DEVICE_ATTR_RO(core_id);
...@@ -72,6 +75,7 @@ static DEVICE_ATTR_RO(drawer_siblings_list); ...@@ -72,6 +75,7 @@ static DEVICE_ATTR_RO(drawer_siblings_list);
static struct attribute *default_attrs[] = { static struct attribute *default_attrs[] = {
&dev_attr_physical_package_id.attr, &dev_attr_physical_package_id.attr,
&dev_attr_die_id.attr,
&dev_attr_core_id.attr, &dev_attr_core_id.attr,
&dev_attr_thread_siblings.attr, &dev_attr_thread_siblings.attr,
&dev_attr_thread_siblings_list.attr, &dev_attr_thread_siblings_list.attr,
......
...@@ -185,6 +185,9 @@ static inline int cpu_to_mem(int cpu) ...@@ -185,6 +185,9 @@ static inline int cpu_to_mem(int cpu)
#ifndef topology_physical_package_id #ifndef topology_physical_package_id
#define topology_physical_package_id(cpu) ((void)(cpu), -1) #define topology_physical_package_id(cpu) ((void)(cpu), -1)
#endif #endif
#ifndef topology_die_id
#define topology_die_id(cpu) ((void)(cpu), -1)
#endif
#ifndef topology_core_id #ifndef topology_core_id
#define topology_core_id(cpu) ((void)(cpu), 0) #define topology_core_id(cpu) ((void)(cpu), 0)
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册