diff options
author | Andi Kleen <ak@suse.de> | 2005-09-12 12:49:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-12 13:49:57 -0400 |
commit | 69e1a33f62eff9b228a8cc2c3e4429dbee8966c9 (patch) | |
tree | 985f088d05f2d936cfafa5dd0232aa59391dc663 /arch/x86_64 | |
parent | 413588c7cb8113c03d0044f1d41b832ad7201c29 (diff) |
[PATCH] x86-64: Use ACPI PXM to parse PCI<->node assignments
Since this is shared code I had to implement it for i386 too
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/mpparse.c | 2 | ||||
-rw-r--r-- | arch/x86_64/mm/srat.c | 7 | ||||
-rw-r--r-- | arch/x86_64/pci/k8-bus.c | 10 |
3 files changed, 15 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index 312ecc9e5f7f..11642526c5b7 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -46,8 +46,6 @@ int acpi_found_madt; | |||
46 | int apic_version [MAX_APICS]; | 46 | int apic_version [MAX_APICS]; |
47 | unsigned char mp_bus_id_to_type [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; | 47 | unsigned char mp_bus_id_to_type [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; |
48 | int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; | 48 | int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; |
49 | unsigned char pci_bus_to_node [256]; | ||
50 | EXPORT_SYMBOL(pci_bus_to_node); | ||
51 | 49 | ||
52 | static int mp_current_pci_id = 0; | 50 | static int mp_current_pci_id = 0; |
53 | /* I/O APIC entries */ | 51 | /* I/O APIC entries */ |
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index 92f6ec79b232..db6b073a149f 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
@@ -25,6 +25,13 @@ static nodemask_t nodes_found __initdata; | |||
25 | static struct node nodes[MAX_NUMNODES] __initdata; | 25 | static struct node nodes[MAX_NUMNODES] __initdata; |
26 | static __u8 pxm2node[256] = { [0 ... 255] = 0xff }; | 26 | static __u8 pxm2node[256] = { [0 ... 255] = 0xff }; |
27 | 27 | ||
28 | int pxm_to_node(int pxm) | ||
29 | { | ||
30 | if ((unsigned)pxm >= 256) | ||
31 | return 0; | ||
32 | return pxm2node[pxm]; | ||
33 | } | ||
34 | |||
28 | static __init int setup_node(int pxm) | 35 | static __init int setup_node(int pxm) |
29 | { | 36 | { |
30 | unsigned node = pxm2node[pxm]; | 37 | unsigned node = pxm2node[pxm]; |
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c index d80c323669e0..3acf60ded2a0 100644 --- a/arch/x86_64/pci/k8-bus.c +++ b/arch/x86_64/pci/k8-bus.c | |||
@@ -58,10 +58,16 @@ fill_mp_bus_to_cpumask(void) | |||
58 | for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); | 58 | for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); |
59 | j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); | 59 | j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); |
60 | j++) { | 60 | j++) { |
61 | int node = NODE_ID(nid); | 61 | struct pci_bus *bus; |
62 | long node = NODE_ID(nid); | ||
63 | /* Algorithm a bit dumb, but | ||
64 | it shouldn't matter here */ | ||
65 | bus = pci_find_bus(0, j); | ||
66 | if (!bus) | ||
67 | continue; | ||
62 | if (!node_online(node)) | 68 | if (!node_online(node)) |
63 | node = 0; | 69 | node = 0; |
64 | pci_bus_to_node[j] = node; | 70 | bus->sysdata = (void *)node; |
65 | } | 71 | } |
66 | } | 72 | } |
67 | } | 73 | } |