diff options
author | Tejun Heo <tj@kernel.org> | 2011-05-02 11:24:48 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-05-02 11:24:48 -0400 |
commit | 2706a0bf7b02693ed88752df877f10c2206292ff (patch) | |
tree | 0d59965472ca83443defb291e909a585e553b6d6 /arch | |
parent | c6f58878204b0414e00b43f9bcebf754284f95b4 (diff) |
x86, NUMA: Enable CONFIG_AMD_NUMA on 32bit too
Now that NUMA init path is unified, amdtopology can be enabled on
32bit. Make amdtopology.c safe on 32bit by explicitly using u64 and
drop X86_64 dependency from Kconfig.
Inclusion of bootmem.h is added for max_pfn declaration.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/mm/amdtopology.c | 21 |
2 files changed, 12 insertions, 11 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8db4fbf30b59..50cb68d2901d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1174,7 +1174,7 @@ comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI" | |||
1174 | config AMD_NUMA | 1174 | config AMD_NUMA |
1175 | def_bool y | 1175 | def_bool y |
1176 | prompt "Old style AMD Opteron NUMA detection" | 1176 | prompt "Old style AMD Opteron NUMA detection" |
1177 | depends on X86_64 && NUMA && PCI | 1177 | depends on NUMA && PCI |
1178 | ---help--- | 1178 | ---help--- |
1179 | Enable AMD NUMA node topology detection. You should say Y here if | 1179 | Enable AMD NUMA node topology detection. You should say Y here if |
1180 | you have a multi processor AMD system. This uses an old method to | 1180 | you have a multi processor AMD system. This uses an old method to |
diff --git a/arch/x86/mm/amdtopology.c b/arch/x86/mm/amdtopology.c index 0919c26820d4..5247d01329ca 100644 --- a/arch/x86/mm/amdtopology.c +++ b/arch/x86/mm/amdtopology.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/nodemask.h> | 13 | #include <linux/nodemask.h> |
14 | #include <linux/memblock.h> | 14 | #include <linux/memblock.h> |
15 | #include <linux/bootmem.h> | ||
15 | 16 | ||
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
17 | #include <linux/pci_ids.h> | 18 | #include <linux/pci_ids.h> |
@@ -69,10 +70,10 @@ static __init void early_get_boot_cpu_id(void) | |||
69 | 70 | ||
70 | int __init amd_numa_init(void) | 71 | int __init amd_numa_init(void) |
71 | { | 72 | { |
72 | unsigned long start = PFN_PHYS(0); | 73 | u64 start = PFN_PHYS(0); |
73 | unsigned long end = PFN_PHYS(max_pfn); | 74 | u64 end = PFN_PHYS(max_pfn); |
74 | unsigned numnodes; | 75 | unsigned numnodes; |
75 | unsigned long prevbase; | 76 | u64 prevbase; |
76 | int i, j, nb; | 77 | int i, j, nb; |
77 | u32 nodeid, reg; | 78 | u32 nodeid, reg; |
78 | unsigned int bits, cores, apicid_base; | 79 | unsigned int bits, cores, apicid_base; |
@@ -95,7 +96,7 @@ int __init amd_numa_init(void) | |||
95 | 96 | ||
96 | prevbase = 0; | 97 | prevbase = 0; |
97 | for (i = 0; i < 8; i++) { | 98 | for (i = 0; i < 8; i++) { |
98 | unsigned long base, limit; | 99 | u64 base, limit; |
99 | 100 | ||
100 | base = read_pci_config(0, nb, 1, 0x40 + i*8); | 101 | base = read_pci_config(0, nb, 1, 0x40 + i*8); |
101 | limit = read_pci_config(0, nb, 1, 0x44 + i*8); | 102 | limit = read_pci_config(0, nb, 1, 0x44 + i*8); |
@@ -107,18 +108,18 @@ int __init amd_numa_init(void) | |||
107 | continue; | 108 | continue; |
108 | } | 109 | } |
109 | if (nodeid >= numnodes) { | 110 | if (nodeid >= numnodes) { |
110 | pr_info("Ignoring excess node %d (%lx:%lx)\n", nodeid, | 111 | pr_info("Ignoring excess node %d (%Lx:%Lx)\n", nodeid, |
111 | base, limit); | 112 | base, limit); |
112 | continue; | 113 | continue; |
113 | } | 114 | } |
114 | 115 | ||
115 | if (!limit) { | 116 | if (!limit) { |
116 | pr_info("Skipping node entry %d (base %lx)\n", | 117 | pr_info("Skipping node entry %d (base %Lx)\n", |
117 | i, base); | 118 | i, base); |
118 | continue; | 119 | continue; |
119 | } | 120 | } |
120 | if ((base >> 8) & 3 || (limit >> 8) & 3) { | 121 | if ((base >> 8) & 3 || (limit >> 8) & 3) { |
121 | pr_err("Node %d using interleaving mode %lx/%lx\n", | 122 | pr_err("Node %d using interleaving mode %Lx/%Lx\n", |
122 | nodeid, (base >> 8) & 3, (limit >> 8) & 3); | 123 | nodeid, (base >> 8) & 3, (limit >> 8) & 3); |
123 | return -EINVAL; | 124 | return -EINVAL; |
124 | } | 125 | } |
@@ -150,19 +151,19 @@ int __init amd_numa_init(void) | |||
150 | continue; | 151 | continue; |
151 | } | 152 | } |
152 | if (limit < base) { | 153 | if (limit < base) { |
153 | pr_err("Node %d bogus settings %lx-%lx.\n", | 154 | pr_err("Node %d bogus settings %Lx-%Lx.\n", |
154 | nodeid, base, limit); | 155 | nodeid, base, limit); |
155 | continue; | 156 | continue; |
156 | } | 157 | } |
157 | 158 | ||
158 | /* Could sort here, but pun for now. Should not happen anyroads. */ | 159 | /* Could sort here, but pun for now. Should not happen anyroads. */ |
159 | if (prevbase > base) { | 160 | if (prevbase > base) { |
160 | pr_err("Node map not sorted %lx,%lx\n", | 161 | pr_err("Node map not sorted %Lx,%Lx\n", |
161 | prevbase, base); | 162 | prevbase, base); |
162 | return -EINVAL; | 163 | return -EINVAL; |
163 | } | 164 | } |
164 | 165 | ||
165 | pr_info("Node %d MemBase %016lx Limit %016lx\n", | 166 | pr_info("Node %d MemBase %016Lx Limit %016Lx\n", |
166 | nodeid, base, limit); | 167 | nodeid, base, limit); |
167 | 168 | ||
168 | prevbase = base; | 169 | prevbase = base; |