|
@@ -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);
|
|
|
|
- id = ((x >> 24) & 0xffU) | ((value << 2) & 0xff00U);
|
|
|
|
|
|
+ if (static_cpu_has_safe(X86_FEATURE_NODEID_MSR)) {
|
|
|
|
+ rdmsrl(MSR_FAM10H_NODE_ID, value);
|
|
|
|
+ id |= (value << 2) & 0xff00;
|
|
|
|
+ }
|
|
|
|
|
|
return id;
|
|
return id;
|
|
}
|
|
}
|
|
@@ -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) {
|
|
|
|
- c->phys_proc_id = node;
|
|
|
|
- per_cpu(cpu_llc_id, smp_processor_id()) = node;
|
|
|
|
|
|
+ u64 val;
|
|
|
|
+ u32 nodes = 1;
|
|
|
|
+
|
|
|
|
+ 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)
|