aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDaniel J Blueman <daniel@numascale-asia.com>2012-10-01 02:42:05 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-10-17 14:25:32 -0400
commit21c5e50e15b1abd797e62f18fd7f90b9cc004cbd (patch)
tree455bfc86f8f51fc5e235c8ddaf9366745b1f082f /arch
parent1bbbbe779aabe1f0768c2bf8f8c0a5583679b54a (diff)
x86, amd, mce: Avoid NULL pointer reference on CPU northbridge lookup
When booting on a federated multi-server system (NumaScale), the processor Northbridge lookup returns NULL; add guards to prevent this causing an oops. On those systems, the northbridge is accessed through MMIO and the "normal" northbridge enumeration in amd_nb.c doesn't work since we're generating the northbridge ID from the initial APIC ID and the last is not unique on those systems. Long story short, we end up without northbridge descriptors. Signed-off-by: Daniel J Blueman <daniel@numascale-asia.com> Cc: stable@vger.kernel.org # 3.6 Link: http://lkml.kernel.org/r/1349073725-14093-1-git-send-email-daniel@numascale-asia.com [ Boris: beef up commit message ] Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index c4e916d77378..698b6ec12e0f 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -576,12 +576,10 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
576 int err = 0; 576 int err = 0;
577 577
578 if (shared_bank[bank]) { 578 if (shared_bank[bank]) {
579
580 nb = node_to_amd_nb(amd_get_nb_id(cpu)); 579 nb = node_to_amd_nb(amd_get_nb_id(cpu));
581 WARN_ON(!nb);
582 580
583 /* threshold descriptor already initialized on this node? */ 581 /* threshold descriptor already initialized on this node? */
584 if (nb->bank4) { 582 if (nb && nb->bank4) {
585 /* yes, use it */ 583 /* yes, use it */
586 b = nb->bank4; 584 b = nb->bank4;
587 err = kobject_add(b->kobj, &dev->kobj, name); 585 err = kobject_add(b->kobj, &dev->kobj, name);
@@ -615,8 +613,10 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
615 atomic_set(&b->cpus, 1); 613 atomic_set(&b->cpus, 1);
616 614
617 /* nb is already initialized, see above */ 615 /* nb is already initialized, see above */
618 WARN_ON(nb->bank4); 616 if (nb) {
619 nb->bank4 = b; 617 WARN_ON(nb->bank4);
618 nb->bank4 = b;
619 }
620 } 620 }
621 621
622 err = allocate_threshold_blocks(cpu, bank, 0, 622 err = allocate_threshold_blocks(cpu, bank, 0,