linux/arch/x86_64
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
..
boot kbuild: introduce utsrelease.h 2006-07-03 23:30:54 +02:00
crypto [CRYPTO] aes: Add wrappers for assembly routines 2006-06-26 17:34:42 +10:00
ia32 [PATCH] x86_64: Don't clobber r8-r11 in int 0x80 handler 2006-07-28 19:28:00 -07:00
kernel [PATCH] x86_64: Calgary IOMMU - Multi-Node NULL pointer dereference fix 2006-07-29 20:59:55 -07:00
lib [PATCH] lockdep: irqtrace cleanup of include/asm-x86_64/irqflags.h 2006-07-03 15:27:03 -07:00
mm [PATCH] lockdep: beautify x86_64 stacktraces 2006-07-03 15:27:02 -07:00
oprofile [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
pci [PATCH] x86_64: Clean and enhance up K8 northbridge access code 2006-06-26 10:48:15 -07:00
defconfig [PATCH] x86_64: Update defconfig 2006-07-29 20:59:55 -07:00
Kconfig [PATCH] lockdep: enable on x86_64 2006-07-03 15:27:05 -07:00
Kconfig.debug [PATCH] lockdep: irqtrace subsystem, x86_64 support 2006-07-03 15:27:03 -07:00
Makefile [PATCH] x86_64: Do not use -ffunction-sections for modules 2006-06-26 10:48:21 -07:00