aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-03 13:25:54 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-04 06:01:06 -0400
commitab530e1f781da4d704892daab2bdd568f473687d (patch)
tree38fd2364225dd8ba8051c77df25457cdaa96833f
parentf19dc2f22a180dde3f9e611b76c73f5390c11ecd (diff)
x86: early check if a system is numaq
so we could fall back to one node numa. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/mpparse.c14
-rw-r--r--arch/x86/kernel/numaq_32.c24
-rw-r--r--include/asm-x86/mpspec.h4
-rw-r--r--include/asm-x86/numaq.h1
4 files changed, 33 insertions, 10 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 8898aa49079d..b4a950da2f97 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -70,7 +70,10 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
70 return; 70 return;
71 } 71 }
72#ifdef CONFIG_X86_NUMAQ 72#ifdef CONFIG_X86_NUMAQ
73 apicid = mpc_apic_id(m, translation_table[mpc_record]); 73 if (found_numaq)
74 apicid = mpc_apic_id(m, translation_table[mpc_record]);
75 else
76 apicid = m->mpc_apicid;
74#else 77#else
75 apicid = m->mpc_apicid; 78 apicid = m->mpc_apicid;
76#endif 79#endif
@@ -91,7 +94,8 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
91 str[6] = 0; 94 str[6] = 0;
92 95
93#ifdef CONFIG_X86_NUMAQ 96#ifdef CONFIG_X86_NUMAQ
94 mpc_oem_bus_info(m, str, translation_table[mpc_record]); 97 if (found_numaq)
98 mpc_oem_bus_info(m, str, translation_table[mpc_record]);
95#else 99#else
96 printk(KERN_INFO "Bus #%d is %s\n", m->mpc_busid, str); 100 printk(KERN_INFO "Bus #%d is %s\n", m->mpc_busid, str);
97#endif 101#endif
@@ -112,7 +116,8 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
112#endif 116#endif
113 } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) { 117 } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) {
114#ifdef CONFIG_X86_NUMAQ 118#ifdef CONFIG_X86_NUMAQ
115 mpc_oem_pci_bus(m, translation_table[mpc_record]); 119 if (found_numaq)
120 mpc_oem_pci_bus(m, translation_table[mpc_record]);
116#endif 121#endif
117 clear_bit(m->mpc_busid, mp_bus_not_pci); 122 clear_bit(m->mpc_busid, mp_bus_not_pci);
118#if defined(CONFIG_EISA) || defined (CONFIG_MCA) 123#if defined(CONFIG_EISA) || defined (CONFIG_MCA)
@@ -321,6 +326,9 @@ static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
321{ 326{
322 if (strncmp(oem, "IBM NUMA", 8)) 327 if (strncmp(oem, "IBM NUMA", 8))
323 printk("Warning! May not be a NUMA-Q system!\n"); 328 printk("Warning! May not be a NUMA-Q system!\n");
329 else
330 found_numaq = 1;
331
324 if (mpc->mpc_oemptr) 332 if (mpc->mpc_oemptr)
325 smp_read_mpc_oem((struct mp_config_oemtable *)mpc->mpc_oemptr, 333 smp_read_mpc_oem((struct mp_config_oemtable *)mpc->mpc_oemptr,
326 mpc->mpc_oemsize); 334 mpc->mpc_oemsize);
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index e65281b1634b..922be66668b8 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -31,9 +31,12 @@
31#include <asm/numaq.h> 31#include <asm/numaq.h>
32#include <asm/topology.h> 32#include <asm/topology.h>
33#include <asm/processor.h> 33#include <asm/processor.h>
34#include <asm/mpspec.h>
34 35
35#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) 36#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
36 37
38int found_numaq;
39
37/* 40/*
38 * Function: smp_dump_qct() 41 * Function: smp_dump_qct()
39 * 42 *
@@ -67,13 +70,24 @@ static void __init smp_dump_qct(void)
67 } 70 }
68} 71}
69 72
70/* 73static __init void early_check_numaq(void)
71 * Unlike Summit, we don't really care to let the NUMA-Q 74{
72 * fall back to flat mode. Don't compile for NUMA-Q 75 /*
73 * unless you really need it! 76 * Find possible boot-time SMP configuration:
74 */ 77 */
78 early_find_smp_config();
79 /*
80 * get boot-time SMP configuration:
81 */
82 if (smp_found_config)
83 early_get_smp_config();
84}
85
75int __init get_memcfg_numaq(void) 86int __init get_memcfg_numaq(void)
76{ 87{
88 early_check_numaq();
89 if (!found_numaq)
90 return 0;
77 smp_dump_qct(); 91 smp_dump_qct();
78 return 1; 92 return 1;
79} 93}
diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h
index dbbf363dafb5..f38b68e8de5a 100644
--- a/include/asm-x86/mpspec.h
+++ b/include/asm-x86/mpspec.h
@@ -21,11 +21,11 @@ extern int pic_mode;
21/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */ 21/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */
22#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4) 22#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4)
23 23
24#endif
25
24extern void early_find_smp_config(void); 26extern void early_find_smp_config(void);
25extern void early_get_smp_config(void); 27extern void early_get_smp_config(void);
26 28
27#endif
28
29#if defined(CONFIG_MCA) || defined(CONFIG_EISA) 29#if defined(CONFIG_MCA) || defined(CONFIG_EISA)
30extern int mp_bus_id_to_type[MAX_MP_BUSSES]; 30extern int mp_bus_id_to_type[MAX_MP_BUSSES];
31#endif 31#endif
diff --git a/include/asm-x86/numaq.h b/include/asm-x86/numaq.h
index 94b86c31239a..739d16484b8c 100644
--- a/include/asm-x86/numaq.h
+++ b/include/asm-x86/numaq.h
@@ -28,6 +28,7 @@
28 28
29#ifdef CONFIG_X86_NUMAQ 29#ifdef CONFIG_X86_NUMAQ
30 30
31extern int found_numaq;
31extern int get_memcfg_numaq(void); 32extern int get_memcfg_numaq(void);
32 33
33/* 34/*