aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-08 21:31:54 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-10 05:34:42 -0400
commitd49c4288407b2ffa8cab270cb5bc6882abe969f6 (patch)
tree8ad69dcc6f70ab18a4dfdf8d39dc4dff96ae1fd9
parente0da33646826b66ef933d47ea2fb7a693fd849bf (diff)
x86: make generic arch support NUMAQ
... so it could fall back to normal numa and we'd reduce the impact of the NUMAQ subarch. NUMAQ depends on GENERICARCH also decouple genericarch numa from acpi. also make it fall back to bigsmp if apicid > 8. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/Kconfig74
-rw-r--r--arch/x86/Makefile18
-rw-r--r--arch/x86/boot/compressed/misc.c4
-rw-r--r--arch/x86/kernel/acpi/boot.c4
-rw-r--r--arch/x86/kernel/io_apic_32.c9
-rw-r--r--arch/x86/kernel/mpparse.c73
-rw-r--r--arch/x86/kernel/numaq_32.c2
-rw-r--r--arch/x86/kernel/summit_32.c2
-rw-r--r--arch/x86/mach-es7000/Makefile1
-rw-r--r--arch/x86/mach-es7000/es7000plat.c47
-rw-r--r--arch/x86/mach-generic/Makefile10
-rw-r--r--arch/x86/mach-generic/bigsmp.c2
-rw-r--r--arch/x86/mach-generic/numaq.c41
-rw-r--r--arch/x86/mach-generic/probe.c15
-rw-r--r--arch/x86/pci/Makefile_325
-rw-r--r--arch/x86/pci/numa.c29
-rw-r--r--drivers/acpi/Kconfig1
-rw-r--r--include/asm-x86/mach-generic/mach_mpparse.h7
-rw-r--r--include/asm-x86/mach-numaq/mach_apic.h39
-rw-r--r--include/asm-x86/mach-numaq/mach_mpparse.h11
-rw-r--r--include/asm-x86/mmzone_32.h18
-rw-r--r--include/asm-x86/mpspec.h6
-rw-r--r--include/asm-x86/numaq.h5
-rw-r--r--include/asm-x86/srat.h12
24 files changed, 219 insertions, 216 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9e9761504422..8b89810fe3f2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -268,36 +268,6 @@ config X86_VOYAGER
268 If you do not specifically know you have a Voyager based machine, 268 If you do not specifically know you have a Voyager based machine,
269 say N here, otherwise the kernel you build will not be bootable. 269 say N here, otherwise the kernel you build will not be bootable.
270 270
271config X86_NUMAQ
272 bool "NUMAQ (IBM/Sequent)"
273 depends on SMP && X86_32
274 select NUMA
275 help
276 This option is used for getting Linux to run on a (IBM/Sequent) NUMA
277 multiquad box. This changes the way that processors are bootstrapped,
278 and uses Clustered Logical APIC addressing mode instead of Flat Logical.
279 You will need a new lynxer.elf file to flash your firmware with - send
280 email to <Martin.Bligh@us.ibm.com>.
281
282config X86_SUMMIT
283 bool "Summit/EXA (IBM x440)"
284 depends on X86_32 && SMP
285 help
286 This option is needed for IBM systems that use the Summit/EXA chipset.
287 In particular, it is needed for the x440.
288
289 If you don't have one of these computers, you should say N here.
290 If you want to build a NUMA kernel, you must select ACPI.
291
292config X86_BIGSMP
293 bool "Support for other sub-arch SMP systems with more than 8 CPUs"
294 depends on X86_32 && SMP
295 help
296 This option is needed for the systems that have more than 8 CPUs
297 and if the system is not of any sub-arch type above.
298
299 If you don't have such a system, you should say N here.
300
301config X86_VISWS 271config X86_VISWS
302 bool "SGI 320/540 (Visual Workstation)" 272 bool "SGI 320/540 (Visual Workstation)"
303 depends on X86_32 273 depends on X86_32
@@ -311,12 +281,33 @@ config X86_VISWS
311 and vice versa. See <file:Documentation/sgi-visws.txt> for details. 281 and vice versa. See <file:Documentation/sgi-visws.txt> for details.
312 282
313config X86_GENERICARCH 283config X86_GENERICARCH
314 bool "Generic architecture (Summit, bigsmp, ES7000, default)" 284 bool "Generic architecture"
315 depends on X86_32 285 depends on X86_32
316 help 286 help
317 This option compiles in the Summit, bigsmp, ES7000, default subarchitectures. 287 This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default
318 It is intended for a generic binary kernel. 288 subarchitectures. It is intended for a generic binary kernel.
319 If you want a NUMA kernel, select ACPI. We need SRAT for NUMA. 289 if you select them all, kernel will probe it one by one. and will
290 fallback to default.
291
292if X86_GENERICARCH
293
294config X86_NUMAQ
295 bool "NUMAQ (IBM/Sequent)"
296 depends on SMP && X86_32
297 select NUMA
298 help
299 This option is used for getting Linux to run on a NUMAQ (IBM/Sequent)
300 NUMA multiquad box. This changes the way that processors are
301 bootstrapped, and uses Clustered Logical APIC addressing mode instead
302 of Flat Logical. You will need a new lynxer.elf file to flash your
303 firmware with - send email to <Martin.Bligh@us.ibm.com>.
304
305config X86_SUMMIT
306 bool "Summit/EXA (IBM x440)"
307 depends on X86_32 && SMP
308 help
309 This option is needed for IBM systems that use the Summit/EXA chipset.
310 In particular, it is needed for the x440.
320 311
321config X86_ES7000 312config X86_ES7000
322 bool "Support for Unisys ES7000 IA32 series" 313 bool "Support for Unisys ES7000 IA32 series"
@@ -324,8 +315,15 @@ config X86_ES7000
324 help 315 help
325 Support for Unisys ES7000 systems. Say 'Y' here if this kernel is 316 Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
326 supposed to run on an IA32-based Unisys ES7000 system. 317 supposed to run on an IA32-based Unisys ES7000 system.
327 Only choose this option if you have such a system, otherwise you 318
328 should say N here. 319config X86_BIGSMP
320 bool "Support for big SMP systems with more than 8 CPUs"
321 depends on X86_32 && SMP
322 help
323 This option is needed for the systems that have more than 8 CPUs
324 and if the system is not of any sub-arch type above.
325
326endif
329 327
330config X86_RDC321X 328config X86_RDC321X
331 bool "RDC R-321x SoC" 329 bool "RDC R-321x SoC"
@@ -913,9 +911,9 @@ config X86_PAE
913config NUMA 911config NUMA
914 bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)" 912 bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)"
915 depends on SMP 913 depends on SMP
916 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT || X86_GENERICARCH) && ACPI) && EXPERIMENTAL) 914 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_GENERICARCH || X86_SUMMIT && ACPI) && EXPERIMENTAL)
917 default n if X86_PC 915 default n if X86_PC
918 default y if (X86_NUMAQ || X86_SUMMIT) 916 default y if (X86_NUMAQ || X86_SUMMIT || X86_GENERICARCH)
919 help 917 help
920 Enable NUMA (Non Uniform Memory Access) support. 918 Enable NUMA (Non Uniform Memory Access) support.
921 The kernel will try to allocate memory used by a CPU on the 919 The kernel will try to allocate memory used by a CPU on the
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 30b046bcccb6..d6650131659e 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -117,29 +117,11 @@ mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/
117mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-x86/mach-visws 117mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-x86/mach-visws
118mcore-$(CONFIG_X86_VISWS) := arch/x86/mach-visws/ 118mcore-$(CONFIG_X86_VISWS) := arch/x86/mach-visws/
119 119
120# NUMAQ subarch support
121mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-x86/mach-numaq
122mcore-$(CONFIG_X86_NUMAQ) := arch/x86/mach-default/
123
124# BIGSMP subarch support
125mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-x86/mach-bigsmp
126mcore-$(CONFIG_X86_BIGSMP) := arch/x86/mach-default/
127
128#Summit subarch support
129mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-x86/mach-summit
130mcore-$(CONFIG_X86_SUMMIT) := arch/x86/mach-default/
131
132# generic subarchitecture 120# generic subarchitecture
133mflags-$(CONFIG_X86_GENERICARCH):= -Iinclude/asm-x86/mach-generic 121mflags-$(CONFIG_X86_GENERICARCH):= -Iinclude/asm-x86/mach-generic
134fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/ 122fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
135mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default/ 123mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default/
136 124
137
138# ES7000 subarch support
139mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-x86/mach-es7000
140fcore-$(CONFIG_X86_ES7000) := arch/x86/mach-es7000/
141mcore-$(CONFIG_X86_ES7000) := arch/x86/mach-default/
142
143# RDC R-321x subarch support 125# RDC R-321x subarch support
144mflags-$(CONFIG_X86_RDC321X) := -Iinclude/asm-x86/mach-rdc321x 126mflags-$(CONFIG_X86_RDC321X) := -Iinclude/asm-x86/mach-rdc321x
145mcore-$(CONFIG_X86_RDC321X) := arch/x86/mach-default/ 127mcore-$(CONFIG_X86_RDC321X) := arch/x86/mach-default/
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 90456cee47c3..ba0be6a25ff7 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -221,10 +221,6 @@ static char *vidmem;
221static int vidport; 221static int vidport;
222static int lines, cols; 222static int lines, cols;
223 223
224#ifdef CONFIG_X86_NUMAQ
225void *xquad_portio;
226#endif
227
228#include "../../../../lib/inflate.c" 224#include "../../../../lib/inflate.c"
229 225
230static void *malloc(int size) 226static void *malloc(int size)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index f226bdc19f69..7dc2130046d9 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -848,7 +848,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
848#ifdef CONFIG_X86_IO_APIC 848#ifdef CONFIG_X86_IO_APIC
849#define MP_ISA_BUS 0 849#define MP_ISA_BUS 0
850 850
851#if defined(CONFIG_X86_ES7000) || defined(CONFIG_X86_GENERICARCH) 851#ifdef CONFIG_X86_ES7000
852extern int es7000_plat; 852extern int es7000_plat;
853#endif 853#endif
854 854
@@ -997,7 +997,7 @@ void __init mp_config_acpi_legacy_irqs(void)
997 set_bit(MP_ISA_BUS, mp_bus_not_pci); 997 set_bit(MP_ISA_BUS, mp_bus_not_pci);
998 Dprintk("Bus #%d is ISA\n", MP_ISA_BUS); 998 Dprintk("Bus #%d is ISA\n", MP_ISA_BUS);
999 999
1000#if defined(CONFIG_X86_ES7000) || defined(CONFIG_X86_GENERICARCH) 1000#ifdef CONFIG_X86_ES7000
1001 /* 1001 /*
1002 * Older generations of ES7000 have no legacy identity mappings 1002 * Older generations of ES7000 have no legacy identity mappings
1003 */ 1003 */
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 2285b81ad1d5..97e62a01f1e2 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -1722,7 +1722,6 @@ void disable_IO_APIC(void)
1722 * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 1999 1722 * by Matt Domsch <Matt_Domsch@dell.com> Tue Dec 21 12:25:05 CST 1999
1723 */ 1723 */
1724 1724
1725#ifndef CONFIG_X86_NUMAQ
1726static void __init setup_ioapic_ids_from_mpc(void) 1725static void __init setup_ioapic_ids_from_mpc(void)
1727{ 1726{
1728 union IO_APIC_reg_00 reg_00; 1727 union IO_APIC_reg_00 reg_00;
@@ -1732,6 +1731,11 @@ static void __init setup_ioapic_ids_from_mpc(void)
1732 unsigned char old_id; 1731 unsigned char old_id;
1733 unsigned long flags; 1732 unsigned long flags;
1734 1733
1734#ifdef CONFIG_X86_NUMAQ
1735 if (found_numaq)
1736 return;
1737#endif
1738
1735 /* 1739 /*
1736 * Don't check I/O APIC IDs for xAPIC systems. They have 1740 * Don't check I/O APIC IDs for xAPIC systems. They have
1737 * no meaning without the serial APIC bus. 1741 * no meaning without the serial APIC bus.
@@ -1828,9 +1832,6 @@ static void __init setup_ioapic_ids_from_mpc(void)
1828 apic_printk(APIC_VERBOSE, " ok.\n"); 1832 apic_printk(APIC_VERBOSE, " ok.\n");
1829 } 1833 }
1830} 1834}
1831#else
1832static void __init setup_ioapic_ids_from_mpc(void) { }
1833#endif
1834 1835
1835int no_timer_check __initdata; 1836int no_timer_check __initdata;
1836 1837
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 7591325e616d..1cc7a4b8643f 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -49,15 +49,73 @@ static int __init mpf_checksum(unsigned char *mp, int len)
49} 49}
50 50
51#ifdef CONFIG_X86_NUMAQ 51#ifdef CONFIG_X86_NUMAQ
52int found_numaq;
52/* 53/*
53 * Have to match translation table entries to main table entries by counter 54 * Have to match translation table entries to main table entries by counter
54 * hence the mpc_record variable .... can't see a less disgusting way of 55 * hence the mpc_record variable .... can't see a less disgusting way of
55 * doing this .... 56 * doing this ....
56 */ 57 */
58struct mpc_config_translation {
59 unsigned char mpc_type;
60 unsigned char trans_len;
61 unsigned char trans_type;
62 unsigned char trans_quad;
63 unsigned char trans_global;
64 unsigned char trans_local;
65 unsigned short trans_reserved;
66};
67
57 68
58static int mpc_record; 69static int mpc_record;
59static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] 70static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY]
60 __cpuinitdata; 71 __cpuinitdata;
72
73static inline int generate_logical_apicid(int quad, int phys_apicid)
74{
75 return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1);
76}
77
78
79static inline int mpc_apic_id(struct mpc_config_processor *m,
80 struct mpc_config_translation *translation_record)
81{
82 int quad = translation_record->trans_quad;
83 int logical_apicid = generate_logical_apicid(quad, m->mpc_apicid);
84
85 printk(KERN_DEBUG "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
86 m->mpc_apicid,
87 (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
88 (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
89 m->mpc_apicver, quad, logical_apicid);
90 return logical_apicid;
91}
92
93int mp_bus_id_to_node[MAX_MP_BUSSES];
94
95int mp_bus_id_to_local[MAX_MP_BUSSES];
96
97static void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
98 struct mpc_config_translation *translation)
99{
100 int quad = translation->trans_quad;
101 int local = translation->trans_local;
102
103 mp_bus_id_to_node[m->mpc_busid] = quad;
104 mp_bus_id_to_local[m->mpc_busid] = local;
105 printk(KERN_INFO "Bus #%d is %s (node %d)\n",
106 m->mpc_busid, name, quad);
107}
108
109int quad_local_to_mp_bus_id [NR_CPUS/4][4];
110static void mpc_oem_pci_bus(struct mpc_config_bus *m,
111 struct mpc_config_translation *translation)
112{
113 int quad = translation->trans_quad;
114 int local = translation->trans_local;
115
116 quad_local_to_mp_bus_id[quad][local] = m->mpc_busid;
117}
118
61#endif 119#endif
62 120
63static void __cpuinit MP_processor_info(struct mpc_config_processor *m) 121static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
@@ -321,11 +379,11 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
321 } 379 }
322} 380}
323 381
324static inline void mps_oem_check(struct mp_config_table *mpc, char *oem, 382void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem,
325 char *productid) 383 char *productid)
326{ 384{
327 if (strncmp(oem, "IBM NUMA", 8)) 385 if (strncmp(oem, "IBM NUMA", 8))
328 printk("Warning! May not be a NUMA-Q system!\n"); 386 printk("Warning! Not a NUMA-Q system!\n");
329 else 387 else
330 found_numaq = 1; 388 found_numaq = 1;
331 389
@@ -388,7 +446,16 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
388 return 0; 446 return 0;
389 447
390#ifdef CONFIG_X86_32 448#ifdef CONFIG_X86_32
391 mps_oem_check(mpc, oem, str); 449 /*
450 * need to make sure summit and es7000's mps_oem_check is safe to be
451 * called early via genericarch 's mps_oem_check
452 */
453 if (early) {
454#ifdef CONFIG_X86_NUMAQ
455 numaq_mps_oem_check(mpc, oem, str);
456#endif
457 } else
458 mps_oem_check(mpc, oem, str);
392#endif 459#endif
393 460
394 /* save the local APIC address, it might be non-default */ 461 /* save the local APIC address, it might be non-default */
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index 27b908254fb0..f0f1de1c4a1d 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -36,8 +36,6 @@
36 36
37#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) 37#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
38 38
39int found_numaq;
40
41/* 39/*
42 * Function: smp_dump_qct() 40 * Function: smp_dump_qct()
43 * 41 *
diff --git a/arch/x86/kernel/summit_32.c b/arch/x86/kernel/summit_32.c
index ae751094eba9..d67ce5f044ba 100644
--- a/arch/x86/kernel/summit_32.c
+++ b/arch/x86/kernel/summit_32.c
@@ -36,7 +36,9 @@ static struct rio_table_hdr *rio_table_hdr __initdata;
36static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata; 36static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata;
37static struct rio_detail *rio_devs[MAX_NUMNODES*4] __initdata; 37static struct rio_detail *rio_devs[MAX_NUMNODES*4] __initdata;
38 38
39#ifndef CONFIG_X86_NUMAQ
39static int mp_bus_id_to_node[MAX_MP_BUSSES] __initdata; 40static int mp_bus_id_to_node[MAX_MP_BUSSES] __initdata;
41#endif
40 42
41static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) 43static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
42{ 44{
diff --git a/arch/x86/mach-es7000/Makefile b/arch/x86/mach-es7000/Makefile
index 69dd4da218dc..3ef8b43b62fc 100644
--- a/arch/x86/mach-es7000/Makefile
+++ b/arch/x86/mach-es7000/Makefile
@@ -3,4 +3,3 @@
3# 3#
4 4
5obj-$(CONFIG_X86_ES7000) := es7000plat.o 5obj-$(CONFIG_X86_ES7000) := es7000plat.o
6obj-$(CONFIG_X86_GENERICARCH) := es7000plat.o
diff --git a/arch/x86/mach-es7000/es7000plat.c b/arch/x86/mach-es7000/es7000plat.c
index a41c77a47227..4354ce804889 100644
--- a/arch/x86/mach-es7000/es7000plat.c
+++ b/arch/x86/mach-es7000/es7000plat.c
@@ -177,53 +177,6 @@ find_unisys_acpi_oem_table(unsigned long *oem_addr)
177} 177}
178#endif 178#endif
179 179
180/*
181 * This file also gets compiled if CONFIG_X86_GENERICARCH is set. Generic
182 * arch already has got following function definitions (asm-generic/es7000.c)
183 * hence no need to define these for that case.
184 */
185#ifndef CONFIG_X86_GENERICARCH
186void es7000_sw_apic(void);
187void __init enable_apic_mode(void)
188{
189 es7000_sw_apic();
190 return;
191}
192
193__init int mps_oem_check(struct mp_config_table *mpc, char *oem,
194 char *productid)
195{
196 if (mpc->mpc_oemptr) {
197 struct mp_config_oemtable *oem_table =
198 (struct mp_config_oemtable *)mpc->mpc_oemptr;
199 if (!strncmp(oem, "UNISYS", 6))
200 return parse_unisys_oem((char *)oem_table);
201 }
202 return 0;
203}
204#ifdef CONFIG_ACPI
205/* Hook from generic ACPI tables.c */
206int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
207{
208 unsigned long oem_addr;
209 if (!find_unisys_acpi_oem_table(&oem_addr)) {
210 if (es7000_check_dsdt())
211 return parse_unisys_oem((char *)oem_addr);
212 else {
213 setup_unisys();
214 return 1;
215 }
216 }
217 return 0;
218}
219#else
220int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
221{
222 return 0;
223}
224#endif
225#endif /* COFIG_X86_GENERICARCH */
226
227static void 180static void
228es7000_spin(int n) 181es7000_spin(int n)
229{ 182{
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
index 19d6d407737b..0dbd7803a1d5 100644
--- a/arch/x86/mach-generic/Makefile
+++ b/arch/x86/mach-generic/Makefile
@@ -2,7 +2,11 @@
2# Makefile for the generic architecture 2# Makefile for the generic architecture
3# 3#
4 4
5EXTRA_CFLAGS := -Iarch/x86/kernel 5EXTRA_CFLAGS := -Iarch/x86/kernel
6 6
7obj-y := probe.o summit.o bigsmp.o es7000.o default.o 7obj-y := probe.o default.o
8obj-y += ../../x86/mach-es7000/ 8obj-$(CONFIG_X86_NUMAQ) += numaq.o
9obj-$(CONFIG_X86_SUMMIT) += summit.o
10obj-$(CONFIG_X86_BIGSMP) += bigsmp.o
11obj-$(CONFIG_X86_ES7000) += es7000.o
12obj-$(CONFIG_X86_ES7000) += ../../x86/mach-es7000/
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 2a243019acae..59d771714559 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -23,10 +23,8 @@ static int dmi_bigsmp; /* can be set by dmi scanners */
23 23
24static int hp_ht_bigsmp(const struct dmi_system_id *d) 24static int hp_ht_bigsmp(const struct dmi_system_id *d)
25{ 25{
26#ifdef CONFIG_X86_GENERICARCH
27 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident); 26 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
28 dmi_bigsmp = 1; 27 dmi_bigsmp = 1;
29#endif
30 return 0; 28 return 0;
31} 29}
32 30
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
new file mode 100644
index 000000000000..8091e68764c4
--- /dev/null
+++ b/arch/x86/mach-generic/numaq.c
@@ -0,0 +1,41 @@
1/*
2 * APIC driver for the IBM NUMAQ chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/threads.h>
6#include <linux/cpumask.h>
7#include <linux/smp.h>
8#include <asm/mpspec.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/init.h>
15#include <asm/mach-numaq/mach_apic.h>
16#include <asm/mach-numaq/mach_apicdef.h>
17#include <asm/mach-numaq/mach_ipi.h>
18#include <asm/mach-numaq/mach_mpparse.h>
19#include <asm/mach-numaq/mach_wakecpu.h>
20#include <asm/numaq.h>
21
22static int mps_oem_check(struct mp_config_table *mpc, char *oem,
23 char *productid)
24{
25 numaq_mps_oem_check(mpc, oem, productid);
26 return found_numaq;
27}
28
29static int probe_numaq(void)
30{
31 /* already know from get_memcfg_numaq() */
32 return found_numaq;
33}
34
35/* Hook from generic ACPI tables.c */
36static int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
37{
38 return 0;
39}
40
41struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq);
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index c5ae751b994a..ba18dec48555 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -16,6 +16,7 @@
16#include <asm/apicdef.h> 16#include <asm/apicdef.h>
17#include <asm/genapic.h> 17#include <asm/genapic.h>
18 18
19extern struct genapic apic_numaq;
19extern struct genapic apic_summit; 20extern struct genapic apic_summit;
20extern struct genapic apic_bigsmp; 21extern struct genapic apic_bigsmp;
21extern struct genapic apic_es7000; 22extern struct genapic apic_es7000;
@@ -24,9 +25,18 @@ extern struct genapic apic_default;
24struct genapic *genapic = &apic_default; 25struct genapic *genapic = &apic_default;
25 26
26static struct genapic *apic_probe[] __initdata = { 27static struct genapic *apic_probe[] __initdata = {
28#ifdef CONFIG_X86_NUMAQ
29 &apic_numaq,
30#endif
31#ifdef CONFIG_X86_SUMMIT
27 &apic_summit, 32 &apic_summit,
33#endif
34#ifdef CONFIG_X86_BIGSMP
28 &apic_bigsmp, 35 &apic_bigsmp,
36#endif
37#ifdef CONFIG_X86_ES7000
29 &apic_es7000, 38 &apic_es7000,
39#endif
30 &apic_default, /* must be last */ 40 &apic_default, /* must be last */
31 NULL, 41 NULL,
32}; 42};
@@ -54,6 +64,7 @@ early_param("apic", parse_apic);
54 64
55void __init generic_bigsmp_probe(void) 65void __init generic_bigsmp_probe(void)
56{ 66{
67#if CONFIG_X86_BIGSMP
57 /* 68 /*
58 * This routine is used to switch to bigsmp mode when 69 * This routine is used to switch to bigsmp mode when
59 * - There is no apic= option specified by the user 70 * - There is no apic= option specified by the user
@@ -67,6 +78,7 @@ void __init generic_bigsmp_probe(void)
67 printk(KERN_INFO "Overriding APIC driver with %s\n", 78 printk(KERN_INFO "Overriding APIC driver with %s\n",
68 genapic->name); 79 genapic->name);
69 } 80 }
81#endif
70} 82}
71 83
72void __init generic_apic_probe(void) 84void __init generic_apic_probe(void)
@@ -88,7 +100,8 @@ void __init generic_apic_probe(void)
88 100
89/* These functions can switch the APIC even after the initial ->probe() */ 101/* These functions can switch the APIC even after the initial ->probe() */
90 102
91int __init mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) 103int __init mps_oem_check(struct mp_config_table *mpc, char *oem,
104 char *productid)
92{ 105{
93 int i; 106 int i;
94 for (i = 0; apic_probe[i]; ++i) { 107 for (i = 0; apic_probe[i]; ++i) {
diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32
index 89ec35d00efd..962d96c0495a 100644
--- a/arch/x86/pci/Makefile_32
+++ b/arch/x86/pci/Makefile_32
@@ -13,10 +13,11 @@ pci-y := fixup.o
13pci-$(CONFIG_ACPI) += acpi.o 13pci-$(CONFIG_ACPI) += acpi.o
14pci-y += legacy.o irq.o 14pci-y += legacy.o irq.o
15 15
16# Careful: VISWS and NUMAQ overrule the pci-y above. The colons are 16# Careful: VISWS overrule the pci-y above. The colons are
17# therefor correct. This needs a proper fix by distangling the code. 17# therefor correct. This needs a proper fix by distangling the code.
18pci-$(CONFIG_X86_VISWS) := visws.o fixup.o 18pci-$(CONFIG_X86_VISWS) := visws.o fixup.o
19pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o 19
20pci-$(CONFIG_X86_NUMAQ) += numa.o
20 21
21# Necessary for NUMAQ as well 22# Necessary for NUMAQ as well
22pci-$(CONFIG_NUMA) += mp_bus_to_node.o 23pci-$(CONFIG_NUMA) += mp_bus_to_node.o
diff --git a/arch/x86/pci/numa.c b/arch/x86/pci/numa.c
index d9afbae5092b..99f1ecd485b5 100644
--- a/arch/x86/pci/numa.c
+++ b/arch/x86/pci/numa.c
@@ -6,45 +6,21 @@
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <mach_apic.h> 8#include <mach_apic.h>
9#include <asm/mpspec.h>
9#include "pci.h" 10#include "pci.h"
10 11
11#define XQUAD_PORTIO_BASE 0xfe400000 12#define XQUAD_PORTIO_BASE 0xfe400000
12#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */ 13#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
13 14
14int mp_bus_id_to_node[MAX_MP_BUSSES];
15#define BUS2QUAD(global) (mp_bus_id_to_node[global]) 15#define BUS2QUAD(global) (mp_bus_id_to_node[global])
16 16
17int mp_bus_id_to_local[MAX_MP_BUSSES];
18#define BUS2LOCAL(global) (mp_bus_id_to_local[global]) 17#define BUS2LOCAL(global) (mp_bus_id_to_local[global])
19 18
20void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
21 struct mpc_config_translation *translation)
22{
23 int quad = translation->trans_quad;
24 int local = translation->trans_local;
25
26 mp_bus_id_to_node[m->mpc_busid] = quad;
27 mp_bus_id_to_local[m->mpc_busid] = local;
28 printk(KERN_INFO "Bus #%d is %s (node %d)\n",
29 m->mpc_busid, name, quad);
30}
31
32int quad_local_to_mp_bus_id [NR_CPUS/4][4];
33#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local]) 19#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
34void mpc_oem_pci_bus(struct mpc_config_bus *m,
35 struct mpc_config_translation *translation)
36{
37 int quad = translation->trans_quad;
38 int local = translation->trans_local;
39
40 quad_local_to_mp_bus_id[quad][local] = m->mpc_busid;
41}
42 20
43/* Where the IO area was mapped on multiquad, always 0 otherwise */ 21/* Where the IO area was mapped on multiquad, always 0 otherwise */
44void *xquad_portio; 22void *xquad_portio;
45#ifdef CONFIG_X86_NUMAQ
46EXPORT_SYMBOL(xquad_portio); 23EXPORT_SYMBOL(xquad_portio);
47#endif
48 24
49#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port) 25#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
50 26
@@ -179,6 +155,9 @@ static int __init pci_numa_init(void)
179{ 155{
180 int quad; 156 int quad;
181 157
158 if (!found_numaq)
159 return 0;
160
182 raw_pci_ops = &pci_direct_conf1_mq; 161 raw_pci_ops = &pci_direct_conf1_mq;
183 162
184 if (pcibios_scanned++) 163 if (pcibios_scanned++)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index c52fca833268..860f15f36ce9 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -4,7 +4,6 @@
4 4
5menuconfig ACPI 5menuconfig ACPI
6 bool "ACPI (Advanced Configuration and Power Interface) Support" 6 bool "ACPI (Advanced Configuration and Power Interface) Support"
7 depends on !X86_NUMAQ
8 depends on !X86_VISWS 7 depends on !X86_VISWS
9 depends on !IA64_HP_SIM 8 depends on !IA64_HP_SIM
10 depends on IA64 || X86 9 depends on IA64 || X86
diff --git a/include/asm-x86/mach-generic/mach_mpparse.h b/include/asm-x86/mach-generic/mach_mpparse.h
index 0d0b5ba2e9d1..586cadbf3787 100644
--- a/include/asm-x86/mach-generic/mach_mpparse.h
+++ b/include/asm-x86/mach-generic/mach_mpparse.h
@@ -1,7 +1,10 @@
1#ifndef _MACH_MPPARSE_H 1#ifndef _MACH_MPPARSE_H
2#define _MACH_MPPARSE_H 1 2#define _MACH_MPPARSE_H 1
3 3
4int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid); 4
5int acpi_madt_oem_check(char *oem_id, char *oem_table_id); 5extern int mps_oem_check(struct mp_config_table *mpc, char *oem,
6 char *productid);
7
8extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
6 9
7#endif 10#endif
diff --git a/include/asm-x86/mach-numaq/mach_apic.h b/include/asm-x86/mach-numaq/mach_apic.h
index 75a56e5afbe7..d802465e026a 100644
--- a/include/asm-x86/mach-numaq/mach_apic.h
+++ b/include/asm-x86/mach-numaq/mach_apic.h
@@ -20,8 +20,14 @@ static inline cpumask_t target_cpus(void)
20#define INT_DELIVERY_MODE dest_LowestPrio 20#define INT_DELIVERY_MODE dest_LowestPrio
21#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */ 21#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */
22 22
23#define check_apicid_used(bitmap, apicid) physid_isset(apicid, bitmap) 23static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
24#define check_apicid_present(bit) physid_isset(bit, phys_cpu_present_map) 24{
25 return physid_isset(apicid, bitmap);
26}
27static inline unsigned long check_apicid_present(int bit)
28{
29 return physid_isset(bit, phys_cpu_present_map);
30}
25#define apicid_cluster(apicid) (apicid & 0xF0) 31#define apicid_cluster(apicid) (apicid & 0xF0)
26 32
27static inline int apic_id_registered(void) 33static inline int apic_id_registered(void)
@@ -77,11 +83,6 @@ static inline int cpu_present_to_apicid(int mps_cpu)
77 return BAD_APICID; 83 return BAD_APICID;
78} 84}
79 85
80static inline int generate_logical_apicid(int quad, int phys_apicid)
81{
82 return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1);
83}
84
85static inline int apicid_to_node(int logical_apicid) 86static inline int apicid_to_node(int logical_apicid)
86{ 87{
87 return logical_apicid >> 4; 88 return logical_apicid >> 4;
@@ -95,30 +96,6 @@ static inline physid_mask_t apicid_to_cpu_present(int logical_apicid)
95 return physid_mask_of_physid(cpu + 4*node); 96 return physid_mask_of_physid(cpu + 4*node);
96} 97}
97 98
98struct mpc_config_translation {
99 unsigned char mpc_type;
100 unsigned char trans_len;
101 unsigned char trans_type;
102 unsigned char trans_quad;
103 unsigned char trans_global;
104 unsigned char trans_local;
105 unsigned short trans_reserved;
106};
107
108static inline int mpc_apic_id(struct mpc_config_processor *m,
109 struct mpc_config_translation *translation_record)
110{
111 int quad = translation_record->trans_quad;
112 int logical_apicid = generate_logical_apicid(quad, m->mpc_apicid);
113
114 printk("Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
115 m->mpc_apicid,
116 (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8,
117 (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
118 m->mpc_apicver, quad, logical_apicid);
119 return logical_apicid;
120}
121
122extern void *xquad_portio; 99extern void *xquad_portio;
123 100
124static inline void setup_portio_remap(void) 101static inline void setup_portio_remap(void)
diff --git a/include/asm-x86/mach-numaq/mach_mpparse.h b/include/asm-x86/mach-numaq/mach_mpparse.h
index 459b12401187..626aef6b155f 100644
--- a/include/asm-x86/mach-numaq/mach_mpparse.h
+++ b/include/asm-x86/mach-numaq/mach_mpparse.h
@@ -1,14 +1,7 @@
1#ifndef __ASM_MACH_MPPARSE_H 1#ifndef __ASM_MACH_MPPARSE_H
2#define __ASM_MACH_MPPARSE_H 2#define __ASM_MACH_MPPARSE_H
3 3
4extern void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 4extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem,
5 struct mpc_config_translation *translation); 5 char *productid);
6extern void mpc_oem_pci_bus(struct mpc_config_bus *m,
7 struct mpc_config_translation *translation);
8
9/* Hook from generic ACPI tables.c */
10static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id)
11{
12}
13 6
14#endif /* __ASM_MACH_MPPARSE_H */ 7#endif /* __ASM_MACH_MPPARSE_H */
diff --git a/include/asm-x86/mmzone_32.h b/include/asm-x86/mmzone_32.h
index ab0012888c44..b2298a227567 100644
--- a/include/asm-x86/mmzone_32.h
+++ b/include/asm-x86/mmzone_32.h
@@ -12,11 +12,9 @@
12extern struct pglist_data *node_data[]; 12extern struct pglist_data *node_data[];
13#define NODE_DATA(nid) (node_data[nid]) 13#define NODE_DATA(nid) (node_data[nid])
14 14
15#ifdef CONFIG_X86_NUMAQ 15#include <asm/numaq.h>
16 #include <asm/numaq.h> 16/* summit or generic arch */
17#elif defined(CONFIG_ACPI_SRAT)/* summit or generic arch */ 17#include <asm/srat.h>
18 #include <asm/srat.h>
19#endif
20 18
21extern int get_memcfg_numa_flat(void); 19extern int get_memcfg_numa_flat(void);
22/* 20/*
@@ -26,14 +24,11 @@ extern int get_memcfg_numa_flat(void);
26 */ 24 */
27static inline void get_memcfg_numa(void) 25static inline void get_memcfg_numa(void)
28{ 26{
29#ifdef CONFIG_X86_NUMAQ 27
30 if (get_memcfg_numaq()) 28 if (get_memcfg_numaq())
31 return; 29 return;
32#elif defined(CONFIG_ACPI_SRAT)
33 if (get_memcfg_from_srat()) 30 if (get_memcfg_from_srat())
34 return; 31 return;
35#endif
36
37 get_memcfg_numa_flat(); 32 get_memcfg_numa_flat();
38} 33}
39 34
@@ -42,7 +37,6 @@ extern int early_pfn_to_nid(unsigned long pfn);
42#else /* !CONFIG_NUMA */ 37#else /* !CONFIG_NUMA */
43 38
44#define get_memcfg_numa get_memcfg_numa_flat 39#define get_memcfg_numa get_memcfg_numa_flat
45#define get_zholes_size(n) (0)
46 40
47#endif /* CONFIG_NUMA */ 41#endif /* CONFIG_NUMA */
48 42
@@ -83,9 +77,6 @@ static inline int pfn_to_nid(unsigned long pfn)
83 __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \ 77 __pgdat->node_start_pfn + __pgdat->node_spanned_pages; \
84}) 78})
85 79
86#ifdef CONFIG_X86_NUMAQ /* we have contiguous memory on NUMA-Q */
87#define pfn_valid(pfn) ((pfn) < num_physpages)
88#else
89static inline int pfn_valid(int pfn) 80static inline int pfn_valid(int pfn)
90{ 81{
91 int nid = pfn_to_nid(pfn); 82 int nid = pfn_to_nid(pfn);
@@ -94,7 +85,6 @@ static inline int pfn_valid(int pfn)
94 return (pfn < node_end_pfn(nid)); 85 return (pfn < node_end_pfn(nid));
95 return 0; 86 return 0;
96} 87}
97#endif /* CONFIG_X86_NUMAQ */
98 88
99#endif /* CONFIG_DISCONTIGMEM */ 89#endif /* CONFIG_DISCONTIGMEM */
100 90
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h
index 4451d720ee07..6e9c9588b1fc 100644
--- a/include/asm-x86/mpspec.h
+++ b/include/asm-x86/mpspec.h
@@ -13,6 +13,12 @@ extern int apic_version[MAX_APICS];
13extern u8 apicid_2_node[]; 13extern u8 apicid_2_node[];
14extern int pic_mode; 14extern int pic_mode;
15 15
16#ifdef CONFIG_X86_NUMAQ
17extern int mp_bus_id_to_node[MAX_MP_BUSSES];
18extern int mp_bus_id_to_local[MAX_MP_BUSSES];
19extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
20#endif
21
16#define MAX_APICID 256 22#define MAX_APICID 256
17 23
18#else 24#else
diff --git a/include/asm-x86/numaq.h b/include/asm-x86/numaq.h
index 739d16484b8c..ef068d2465d6 100644
--- a/include/asm-x86/numaq.h
+++ b/include/asm-x86/numaq.h
@@ -157,9 +157,10 @@ struct sys_cfg_data {
157 struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */ 157 struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */
158}; 158};
159 159
160static inline unsigned long *get_zholes_size(int nid) 160#else
161static inline int get_memcfg_numaq(void)
161{ 162{
162 return NULL; 163 return 0;
163} 164}
164#endif /* CONFIG_X86_NUMAQ */ 165#endif /* CONFIG_X86_NUMAQ */
165#endif /* NUMAQ_H */ 166#endif /* NUMAQ_H */
diff --git a/include/asm-x86/srat.h b/include/asm-x86/srat.h
index f4bba131d068..456fe0b5a921 100644
--- a/include/asm-x86/srat.h
+++ b/include/asm-x86/srat.h
@@ -27,11 +27,13 @@
27#ifndef _ASM_SRAT_H_ 27#ifndef _ASM_SRAT_H_
28#define _ASM_SRAT_H_ 28#define _ASM_SRAT_H_
29 29
30#ifndef CONFIG_ACPI_SRAT 30#ifdef CONFIG_ACPI_SRAT
31#error CONFIG_ACPI_SRAT not defined, and srat.h header has been included
32#endif
33
34extern int get_memcfg_from_srat(void); 31extern int get_memcfg_from_srat(void);
35extern unsigned long *get_zholes_size(int); 32#else
33static inline int get_memcfg_from_srat(void)
34{
35 return 0;
36}
37#endif
36 38
37#endif /* _ASM_SRAT_H_ */ 39#endif /* _ASM_SRAT_H_ */