linux/arch/x86_64/kernel
Jon Mason d2105b10fe [PATCH] x86_64: Calgary IOMMU - Multi-Node NULL pointer dereference fix
Calgary hits a NULL pointer dereference when booting in a multi-chassis
NUMA system.  See Redhat bugzilla number 198498, found by Konrad
Rzeszutek (konradr@redhat.com).

There are many issues that had to be resolved to fix this problem.
Firstly when I originally wrote the code to handle NUMA systems, I
had a large misunderstanding that was not corrected until now.  That was
that I thought the "number of nodes online" referred to number of
physical systems connected.  So that if NUMA was disabled, there
would only be 1 node and it would only show that node's PCI bus.
In reality if NUMA is disabled, the system displays all of the
connected chassis as one node but is only ignorant of the delays
in accessing main memory.  Therefore, references to num_online_nodes()
and MAX_NUMNODES are incorrect and need to be set to the maximum
number of nodes that can be accessed (which are 8).  I created a
variable, MAX_NUM_CHASSIS, and set it to 8 to fix this.

Secondly, when walking the PCI in detect_calgary, the code only
checked the first "slot" when looking to see if a device is present.
This will work for most cases, but unfortunately it isn't always the
case.  In the NUMA MXE drawers, there are USB devices present on the
3rd slot (with slot 1 being empty).  So, to work around this, all
slots (up to 8) are scanned to see if there are any devices present.

Lastly, the bus is being enumerated on large systems in a different
way the we originally thought.  This throws the ugly logic we had
out the window.  To more elegantly handle this, I reorganized the
kva array to be sparse (which removed the need to have any bus number
to kva slot logic in tce.c) and created a secondary space array to
contain the bus number to phb mapping.

With these changes Calgary boots on an x460 with 4 nodes with and
without NUMA enabled.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-29 20:59:55 -07:00
..
acpi Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
cpufreq
aperture.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
apic.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
asm-offsets.c [CRYPTO] all: Pass tfm instead of ctx to algorithms 2006-06-26 17:34:39 +10:00
audit.c [PATCH] audit syscall classes 2006-07-01 07:44:10 -04:00
crash_dump.c [PATCH] kdump: read previous kernel's memory 2006-01-10 08:01:28 -08:00
crash.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2006-06-26 13:33:14 -07:00
e820.c [PATCH] x86_64: e820.c needs pgtable.h 2006-07-10 13:24:13 -07:00
early_printk.c [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
entry.S [PATCH] lockdep: irqtrace subsystem, x86_64 support 2006-07-03 15:27:03 -07:00
functionlist [NET]: make skb_release_data() static 2006-06-29 16:58:30 -07:00
genapic_cluster.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
genapic_flat.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
genapic.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
head64.c [PATCH] lockdep: x86_64 early init 2006-07-03 15:27:04 -07:00
head.S [PATCH] x86_64: Patch to make the head.S-must-be-first-in-vmlinux order explicit 2006-03-25 09:10:55 -08:00
i387.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
i8259.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
init_task.c [PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros 2006-01-08 20:13:38 -08:00
io_apic.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ioport.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
irq.c [PATCH] lockdep: irqtrace subsystem, x86_64 support 2006-07-03 15:27:03 -07:00
k8.c [PATCH] x86_64: Clean and enhance up K8 northbridge access code 2006-06-26 10:48:15 -07:00
kprobes.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ldt.c
machine_kexec.c Storage class should be first 2006-06-26 18:57:34 +02:00
Makefile [PATCH] lockdep: stacktrace subsystem, x86_64 support 2006-07-03 15:27:02 -07:00
mce_amd.c [PATCH] x86_64: Fix hotplug problem in mce amd 2006-07-10 15:12:32 -07:00
mce_intel.c [PATCH] x86_64: Some housekeeping in local APIC code 2006-01-11 19:05:03 -08:00
mce.c [PATCH] cpu hotplug: make cpu_notifier related notifier blocks __cpuinit only 2006-06-27 17:32:41 -07:00
module.c [PATCH] x86_64: x86_64 version of the smp alternative patch. 2006-06-26 10:48:14 -07:00
mpparse.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
nmi.c [PATCH] lockdep: annotate enable_in_hardirq() 2006-07-03 15:27:09 -07:00
pci-calgary.c [PATCH] x86_64: Calgary IOMMU - Multi-Node NULL pointer dereference fix 2006-07-29 20:59:55 -07:00
pci-dma.c [PATCH] x86_64: Calgary IOMMU - Calgary specific bits 2006-06-26 10:48:19 -07:00
pci-gart.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pci-nommu.c [PATCH] x86_64: check_addr() cleanups 2006-06-26 10:48:20 -07:00
pci-swiotlb.c [PATCH] x86_64: Calgary IOMMU - introduce iommu_detected 2006-06-26 10:48:18 -07:00
pmtimer.c [PATCH] make pmtmr_ioport __read_mostly 2006-06-26 09:58:21 -07:00
process.c [PATCH] lockdep: beautify x86_64 stacktraces 2006-07-03 15:27:02 -07:00
ptrace.c [PATCH] drop task argument of audit_syscall_{entry,exit} 2006-05-01 06:06:18 -04:00
reboot.c [PATCH] x86_64: Move export symbols to their C functions 2006-06-26 10:48:22 -07:00
relocate_kernel.S [PATCH] kexec: x86_64 kexec implementation 2005-06-25 16:24:50 -07:00
setup64.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
setup.c [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
signal.c [PATCH] x86_64: Remove bogus RED-PEN comment in signal.c 2006-06-26 10:48:20 -07:00
smp.c [PATCH] x86: increase interrupt vector range 2006-06-27 17:32:37 -07:00
smpboot.c [PATCH] lockdep: clean up completion initializer in smpboot.c 2006-07-10 13:24:14 -07:00
stacktrace.c [PATCH] lockdep: stacktrace subsystem, x86_64 support 2006-07-03 15:27:02 -07:00
suspend_asm.S [PATCH] x86_64: Set up safe page tables during resume 2005-10-10 08:36:46 -07:00
suspend.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sys_x86_64.c [PATCH] x86_64: Use common sys_time64 2005-11-14 19:55:17 -08:00
syscall.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
tce.c [PATCH] x86_64: Calgary IOMMU - Multi-Node NULL pointer dereference fix 2006-07-29 20:59:55 -07:00
time.c [PATCH] x86_64: On Intel systems when CPU has C3 don't use TSC 2006-07-29 20:59:55 -07:00
trampoline.S [PATCH] x86_64: Fix SMP bootup with CONFIG_KDUMP enabled 2006-01-11 19:09:58 -08:00
traps.c [PATCH] x86_64: Dump leftover backtrace entries when dwarf2 unwinder got stuck 2006-07-28 19:28:00 -07:00
vmlinux.lds.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
vsmp.c [PATCH] x86_64: Inclusion of ScaleMP vSMP architecture patches - vsmp_arch 2006-01-11 19:05:01 -08:00
vsyscall.c [PATCH] x86_64: fix unlikely profiling & vsyscalls on x86_64 2006-06-26 10:48:16 -07:00
x8664_ksyms.c [PATCH] x86_64: Move export symbols to their C functions 2006-06-26 10:48:22 -07:00