x86, mcheck: Use correct cpumask for shared bank4
authorAndreas Herrmann <andreas.herrmann3@amd.com>
Thu, 3 Sep 2009 07:42:20 +0000 (09:42 +0200)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 3 Sep 2009 22:10:08 +0000 (15:10 -0700)
This fixes threshold_bank4 support on multi-node processors.

The correct mask to use is llc_shared_map, representing an internal
node on Magny-Cours.

We need to create 2 sets of symlinks for sibling shared banks -- one
set for each internal node, symlinks of each set should target the
first core on same internal node.

Currently only one set is created where all symlinks are targeting
the first core of the entire socket.

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/kernel/cpu/mcheck/mce_amd.c

index ddae216..1fecba4 100644 (file)
@@ -489,12 +489,14 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
        int i, err = 0;
        struct threshold_bank *b = NULL;
        char name[32];
+       struct cpuinfo_x86 *c = &cpu_data(cpu);
+
 
        sprintf(name, "threshold_bank%i", bank);
 
 #ifdef CONFIG_SMP
        if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) {   /* symlink */
-               i = cpumask_first(cpu_core_mask(cpu));
+               i = cpumask_first(c->llc_shared_map);
 
                /* first core not up yet */
                if (cpu_data(i).cpu_core_id)
@@ -514,7 +516,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
                if (err)
                        goto out;
 
-               cpumask_copy(b->cpus, cpu_core_mask(cpu));
+               cpumask_copy(b->cpus, c->llc_shared_map);
                per_cpu(threshold_banks, cpu)[bank] = b;
 
                goto out;
@@ -539,7 +541,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
 #ifndef CONFIG_SMP
        cpumask_setall(b->cpus);
 #else
-       cpumask_copy(b->cpus, cpu_core_mask(cpu));
+       cpumask_copy(b->cpus, c->llc_shared_map);
 #endif
 
        per_cpu(threshold_banks, cpu)[bank] = b;