Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] x86_64: Don't oops at boot when empty Opteron node has IO

The code to detect IO links on Opteron would not check
if the node had actually memory. This could lead to pci_bus_to_node
returning an invalid node, which might cause crashes later
when dma_alloc_coherent passes it to page_alloc_node().

The bug has been there forever but for some reason
it is causing now crashes.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andi Kleen and committed by
Linus Torvalds
d3813fcf 2bbfb16b

+11 -2
+11 -2
arch/x86_64/pci/k8-bus.c
··· 47 47 * if there are no busses hanging off of the current 48 48 * ldt link then both the secondary and subordinate 49 49 * bus number fields are set to 0. 50 + * 51 + * RED-PEN 52 + * This is slightly broken because it assumes 53 + * HT node IDs == Linux node ids, which is not always 54 + * true. However it is probably mostly true. 50 55 */ 51 56 if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 52 57 && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { 53 58 for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); 54 59 j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); 55 - j++) 56 - pci_bus_to_node[j] = NODE_ID(nid); 60 + j++) { 61 + int node = NODE_ID(nid); 62 + if (!node_online(node)) 63 + node = 0; 64 + pci_bus_to_node[j] = node; 65 + } 57 66 } 58 67 } 59 68 }