original_kernel/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
Makefile [PATCH] lockdep: stacktrace subsystem, x86_64 support 2006-07-03 15:27:02 -07:00
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
audit.c [PATCH] audit syscall classes 2006-07-01 07:44:10 -04:00
crash.c
crash_dump.c
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.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02: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
head.S
head64.c [PATCH] lockdep: x86_64 early init 2006-07-03 15:27:04 -07: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
io_apic.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ioport.c
irq.c [PATCH] lockdep: irqtrace subsystem, x86_64 support 2006-07-03 15:27:03 -07:00
k8.c
kprobes.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ldt.c
machine_kexec.c
mce.c [PATCH] cpu hotplug: make cpu_notifier related notifier blocks __cpuinit only 2006-06-27 17:32:41 -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
module.c
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
pci-gart.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pci-nommu.c
pci-swiotlb.c
pmtimer.c
process.c [PATCH] lockdep: beautify x86_64 stacktraces 2006-07-03 15:27:02 -07:00
ptrace.c
reboot.c
relocate_kernel.S
setup.c [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
setup64.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
signal.c
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.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
suspend_asm.S
sys_x86_64.c
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
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
vsyscall.c
x8664_ksyms.c