x86/topology: Fix AMD core count
It turns out AMD gets x86_max_cores wrong when there are compute
units.
The issue is that Linux assumes:
nr_logical_cpus = nr_cores * nr_siblings
But AMD reports its CU unit as 2 cores, but then sets num_smp_siblings
to 2 as well.
Boris: fixup ras/mce_amd_inj.c too, to compute the Node Base Core
properly, according to the new nomenclature.
Fixes: 1f12e32f4c
("x86/topology: Create logical package id")
Reported-by: Xiong Zhou <jencce.kernel@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andreas Herrmann <aherrmann@suse.com>
Cc: Andy Lutomirski <luto@kernel.org>
Link: http://lkml.kernel.org/r/20160317095220.GO6344@twins.programming.kicks-ass.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:

committed by
Thomas Gleixner

parent
f55532a0c0
commit
ee6825c80e
@@ -20,6 +20,7 @@
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include <asm/mce.h>
|
||||
#include <asm/smp.h>
|
||||
#include <asm/amd_nb.h>
|
||||
#include <asm/irq_vectors.h>
|
||||
|
||||
@@ -206,7 +207,7 @@ static u32 get_nbc_for_node(int node_id)
|
||||
struct cpuinfo_x86 *c = &boot_cpu_data;
|
||||
u32 cores_per_node;
|
||||
|
||||
cores_per_node = c->x86_max_cores / amd_get_nodes_per_socket();
|
||||
cores_per_node = (c->x86_max_cores * smp_num_siblings) / amd_get_nodes_per_socket();
|
||||
|
||||
return cores_per_node * node_id;
|
||||
}
|
||||
|
Reference in New Issue
Block a user