aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authortravis@sgi.com <travis@sgi.com>2008-01-30 07:33:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:10 -0500
commitef97001f3d869d7cc1956e0cc0d89e514e3f7db0 (patch)
treea66c041d96367f049143d63ebcc85e0b7d6dce34 /arch
parenta1bf250a6f31afb8caac166ae50dc7b89c38084c (diff)
x86: change size of APICIDs from u8 to u16
Change the size of APICIDs from u8 to u16. This partially supports the new x2apic mode that will be present on future processor chips. (Chips actually support 32-bit APICIDs, but that change is more intrusive. Supporting 16-bit is sufficient for now). Signed-off-by: Jack Steiner <steiner@sgi.com> I've included just the partial change from u8 to u16 apicids. The remaining x2apic changes will be in a separate patch. In addition, the fake_node_to_pxm_map[] and fake_apicid_to_node[] tables have been moved from local data to the __initdata section reducing stack pressure when MAX_NUMNODES and MAX_LOCAL_APIC are increased in size. Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/genapic_64.c4
-rw-r--r--arch/x86/kernel/mpparse_64.c4
-rw-r--r--arch/x86/kernel/smpboot_64.c2
-rw-r--r--arch/x86/mm/numa_64.c2
-rw-r--r--arch/x86/mm/srat_64.c22
5 files changed, 19 insertions, 15 deletions
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c
index ce703e21c912..ac2b78f24074 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/genapic_64.c
@@ -32,10 +32,10 @@
32 * array during this time. Is it zeroed when the per_cpu 32 * array during this time. Is it zeroed when the per_cpu
33 * data area is removed. 33 * data area is removed.
34 */ 34 */
35u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata 35u16 x86_cpu_to_apicid_init[NR_CPUS] __initdata
36 = { [0 ... NR_CPUS-1] = BAD_APICID }; 36 = { [0 ... NR_CPUS-1] = BAD_APICID };
37void *x86_cpu_to_apicid_ptr; 37void *x86_cpu_to_apicid_ptr;
38DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID; 38DEFINE_PER_CPU(u16, x86_cpu_to_apicid) = BAD_APICID;
39EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); 39EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid);
40 40
41struct genapic __read_mostly *genapic = &apic_flat; 41struct genapic __read_mostly *genapic = &apic_flat;
diff --git a/arch/x86/kernel/mpparse_64.c b/arch/x86/kernel/mpparse_64.c
index ef4aab123581..17d21e5b22d6 100644
--- a/arch/x86/kernel/mpparse_64.c
+++ b/arch/x86/kernel/mpparse_64.c
@@ -67,7 +67,7 @@ unsigned disabled_cpus __cpuinitdata;
67/* Bitmask of physically existing CPUs */ 67/* Bitmask of physically existing CPUs */
68physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; 68physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE;
69 69
70u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 70u16 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
71 71
72 72
73/* 73/*
@@ -132,7 +132,7 @@ static void __cpuinit MP_processor_info(struct mpc_config_processor *m)
132 * area is created. 132 * area is created.
133 */ 133 */
134 if (x86_cpu_to_apicid_ptr) { 134 if (x86_cpu_to_apicid_ptr) {
135 u8 *x86_cpu_to_apicid = (u8 *)x86_cpu_to_apicid_ptr; 135 u16 *x86_cpu_to_apicid = (u16 *)x86_cpu_to_apicid_ptr;
136 x86_cpu_to_apicid[cpu] = m->mpc_apicid; 136 x86_cpu_to_apicid[cpu] = m->mpc_apicid;
137 } else { 137 } else {
138 per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid; 138 per_cpu(x86_cpu_to_apicid, cpu) = m->mpc_apicid;
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 5bd42ce144da..1fea185c9dca 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -65,7 +65,7 @@ int smp_num_siblings = 1;
65EXPORT_SYMBOL(smp_num_siblings); 65EXPORT_SYMBOL(smp_num_siblings);
66 66
67/* Last level cache ID of each logical CPU */ 67/* Last level cache ID of each logical CPU */
68DEFINE_PER_CPU(u8, cpu_llc_id) = BAD_APICID; 68DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID;
69 69
70/* Bitmask of currently online CPUs */ 70/* Bitmask of currently online CPUs */
71cpumask_t cpu_online_map __read_mostly; 71cpumask_t cpu_online_map __read_mostly;
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 551e3590e5c5..650001a87c8f 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -626,7 +626,7 @@ void __init init_cpu_to_node(void)
626 int i; 626 int i;
627 627
628 for (i = 0; i < NR_CPUS; i++) { 628 for (i = 0; i < NR_CPUS; i++) {
629 u8 apicid = x86_cpu_to_apicid_init[i]; 629 u16 apicid = x86_cpu_to_apicid_init[i];
630 630
631 if (apicid == BAD_APICID) 631 if (apicid == BAD_APICID)
632 continue; 632 continue;
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 5c0637e4c2f4..b367bc342fe0 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -130,6 +130,9 @@ void __init
130acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) 130acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
131{ 131{
132 int pxm, node; 132 int pxm, node;
133 int apic_id;
134
135 apic_id = pa->apic_id;
133 if (srat_disabled()) 136 if (srat_disabled())
134 return; 137 return;
135 if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) { 138 if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
@@ -145,10 +148,10 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
145 bad_srat(); 148 bad_srat();
146 return; 149 return;
147 } 150 }
148 apicid_to_node[pa->apic_id] = node; 151 apicid_to_node[apic_id] = node;
149 acpi_numa = 1; 152 acpi_numa = 1;
150 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 153 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n",
151 pxm, pa->apic_id, node); 154 pxm, apic_id, node);
152} 155}
153 156
154int update_end_of_memory(unsigned long end) {return -1;} 157int update_end_of_memory(unsigned long end) {return -1;}
@@ -343,7 +346,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
343 /* First clean up the node list */ 346 /* First clean up the node list */
344 for (i = 0; i < MAX_NUMNODES; i++) { 347 for (i = 0; i < MAX_NUMNODES; i++) {
345 cutoff_node(i, start, end); 348 cutoff_node(i, start, end);
346 if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) { 349 /* ZZZ why was this needed. At least add a comment */
350 if (nodes[i].end && (nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
347 unparse_node(i); 351 unparse_node(i);
348 node_set_offline(i); 352 node_set_offline(i);
349 } 353 }
@@ -384,6 +388,12 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
384} 388}
385 389
386#ifdef CONFIG_NUMA_EMU 390#ifdef CONFIG_NUMA_EMU
391static int fake_node_to_pxm_map[MAX_NUMNODES] __initdata = {
392 [0 ... MAX_NUMNODES-1] = PXM_INVAL
393};
394static unsigned char fake_apicid_to_node[MAX_LOCAL_APIC] __initdata = {
395 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
396};
387static int __init find_node_by_addr(unsigned long addr) 397static int __init find_node_by_addr(unsigned long addr)
388{ 398{
389 int ret = NUMA_NO_NODE; 399 int ret = NUMA_NO_NODE;
@@ -414,12 +424,6 @@ static int __init find_node_by_addr(unsigned long addr)
414void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes) 424void __init acpi_fake_nodes(const struct bootnode *fake_nodes, int num_nodes)
415{ 425{
416 int i, j; 426 int i, j;
417 int fake_node_to_pxm_map[MAX_NUMNODES] = {
418 [0 ... MAX_NUMNODES-1] = PXM_INVAL
419 };
420 unsigned char fake_apicid_to_node[MAX_LOCAL_APIC] = {
421 [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
422 };
423 427
424 printk(KERN_INFO "Faking PXM affinity for fake nodes on real " 428 printk(KERN_INFO "Faking PXM affinity for fake nodes on real "
425 "topology.\n"); 429 "topology.\n");