提交 c8a470ca 编写于 作者: D Daniel J Blueman 提交者: Ingo Molnar

x86/apic/numachip: Fix sibling map with NumaChip

On NumaChip systems, the physical processor ID assignment wasn't
accounting for the number of nodes in AMD multi-module
processors, giving an incorrect sibling map:

  $ cd /sys/devices/system/cpu/cpu29/topology
  $ grep . *
  core_id:5
  core_siblings:00000000,ff000000
  core_siblings_list:24-31
  physical_package_id:3
  thread_siblings:00000000,30000000
  thread_siblings_list:28-29

This fixes it:

  $ cd /sys/devices/system/cpu/cpu29/topology
  $ grep . *
  core_id:5
  core_siblings:00000000,ffff0000
  core_siblings_list:16-31
  physical_package_id:1
  thread_siblings:00000000,30000000
  thread_siblings_list:28-29
Signed-off-by: NDaniel J Blueman <daniel@numascale.com>
Signed-off-by: NBorislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Steffen Persvold <sp@numascale.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1426135950-10110-1-git-send-email-daniel@numascale.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 7486341a
...@@ -37,10 +37,12 @@ static const struct apic apic_numachip; ...@@ -37,10 +37,12 @@ static const struct apic apic_numachip;
static unsigned int get_apic_id(unsigned long x) static unsigned int get_apic_id(unsigned long x)
{ {
unsigned long value; unsigned long value;
unsigned int id; unsigned int id = (x >> 24) & 0xff;
rdmsrl(MSR_FAM10H_NODE_ID, value); if (static_cpu_has_safe(X86_FEATURE_NODEID_MSR)) {
id = ((x >> 24) & 0xffU) | ((value << 2) & 0xff00U); rdmsrl(MSR_FAM10H_NODE_ID, value);
id |= (value << 2) & 0xff00;
}
return id; return id;
} }
...@@ -155,10 +157,18 @@ static int __init numachip_probe(void) ...@@ -155,10 +157,18 @@ static int __init numachip_probe(void)
static void fixup_cpu_id(struct cpuinfo_x86 *c, int node) static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
{ {
if (c->phys_proc_id != node) { u64 val;
c->phys_proc_id = node; u32 nodes = 1;
per_cpu(cpu_llc_id, smp_processor_id()) = node;
this_cpu_write(cpu_llc_id, node);
/* Account for nodes per socket in multi-core-module processors */
if (static_cpu_has_safe(X86_FEATURE_NODEID_MSR)) {
rdmsrl(MSR_FAM10H_NODE_ID, val);
nodes = ((val >> 3) & 7) + 1;
} }
c->phys_proc_id = node / nodes;
} }
static int __init numachip_system_init(void) static int __init numachip_system_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册