aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:49:25 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:49:25 -0500
commit7d14f145f839b5d0d221ea209b4998f93267e2ec (patch)
tree669d09ad53c9de9ef2e6cef06d256a811d509d65 /arch
parent2e1ca21d46aaef95101723fa402f39d3a95aba59 (diff)
parent4129a953ad4db379d8e07b0dd2157998653a1325 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64] New IA64 core/thread detection patch [IA64] Increase max node count on SN platforms [IA64] Increase max node count on SN platforms [IA64] Increase max node count on SN platforms [IA64] Increase max node count on SN platforms [IA64] Tollhouse HP: IA64 arch changes [IA64] cleanup dig_irq_init [IA64] MCA recovery: kernel context recovery table IA64: Use early_parm to handle mvec_name and nomca [IA64] move patchlist and machvec into init section [IA64] add init declaration - nolwsys [IA64] add init declaration - gate page functions [IA64] add init declaration to memory initialization functions [IA64] add init declaration to cpu initialization functions [IA64] add __init declaration to mca functions [IA64] Ignore disabled Local SAPIC Affinity Structure in SRAT [IA64] sn_check_intr: use ia64_get_irr() [IA64] fix ia64 is_hugepage_only_range
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/Kconfig9
-rw-r--r--arch/ia64/configs/gensparse_defconfig1
-rw-r--r--arch/ia64/configs/sn2_defconfig1
-rw-r--r--arch/ia64/defconfig1
-rw-r--r--arch/ia64/dig/setup.c5
-rw-r--r--arch/ia64/kernel/acpi.c35
-rw-r--r--arch/ia64/kernel/ivt.S1
-rw-r--r--arch/ia64/kernel/machvec.c19
-rw-r--r--arch/ia64/kernel/mca.c110
-rw-r--r--arch/ia64/kernel/mca_drv.c22
-rw-r--r--arch/ia64/kernel/mca_drv.h7
-rw-r--r--arch/ia64/kernel/mca_drv_asm.S13
-rw-r--r--arch/ia64/kernel/numa.c2
-rw-r--r--arch/ia64/kernel/patch.c8
-rw-r--r--arch/ia64/kernel/setup.c60
-rw-r--r--arch/ia64/kernel/smpboot.c109
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S60
-rw-r--r--arch/ia64/mm/contig.c8
-rw-r--r--arch/ia64/mm/discontig.c2
-rw-r--r--arch/ia64/mm/hugetlbpage.c7
-rw-r--r--arch/ia64/mm/init.c16
-rw-r--r--arch/ia64/sn/kernel/io_init.c29
-rw-r--r--arch/ia64/sn/kernel/irq.c21
-rw-r--r--arch/ia64/sn/kernel/tiocx.c10
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c17
25 files changed, 303 insertions, 270 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index ff7ae6b664e8..10b6b9e7716b 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -252,6 +252,15 @@ config NR_CPUS
252 than 64 will cause the use of a CPU mask array, causing a small 252 than 64 will cause the use of a CPU mask array, causing a small
253 performance hit. 253 performance hit.
254 254
255config IA64_NR_NODES
256 int "Maximum number of NODEs (256-1024)" if (IA64_SGI_SN2 || IA64_GENERIC)
257 range 256 1024
258 depends on IA64_SGI_SN2 || IA64_GENERIC
259 default "256"
260 help
261 This option specifies the maximum number of nodes in your SSI system.
262 If in doubt, use the default.
263
255config HOTPLUG_CPU 264config HOTPLUG_CPU
256 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 265 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
257 depends on SMP && EXPERIMENTAL 266 depends on SMP && EXPERIMENTAL
diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig
index 744fd2f79f61..0d29aa2066b3 100644
--- a/arch/ia64/configs/gensparse_defconfig
+++ b/arch/ia64/configs/gensparse_defconfig
@@ -116,6 +116,7 @@ CONFIG_IOSAPIC=y
116CONFIG_FORCE_MAX_ZONEORDER=17 116CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 117CONFIG_SMP=y
118CONFIG_NR_CPUS=512 118CONFIG_NR_CPUS=512
119CONFIG_IA64_NR_NODES=256
119CONFIG_HOTPLUG_CPU=y 120CONFIG_HOTPLUG_CPU=y
120# CONFIG_SCHED_SMT is not set 121# CONFIG_SCHED_SMT is not set
121# CONFIG_PREEMPT is not set 122# CONFIG_PREEMPT is not set
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 8206752161bb..a718034d68d0 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -116,6 +116,7 @@ CONFIG_IA64_SGI_SN_XP=m
116CONFIG_FORCE_MAX_ZONEORDER=17 116CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 117CONFIG_SMP=y
118CONFIG_NR_CPUS=1024 118CONFIG_NR_CPUS=1024
119CONFIG_IA64_NR_NODES=256
119# CONFIG_HOTPLUG_CPU is not set 120# CONFIG_HOTPLUG_CPU is not set
120CONFIG_SCHED_SMT=y 121CONFIG_SCHED_SMT=y
121CONFIG_PREEMPT=y 122CONFIG_PREEMPT=y
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 3e767288a745..6cba55da572a 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -116,6 +116,7 @@ CONFIG_IOSAPIC=y
116CONFIG_FORCE_MAX_ZONEORDER=17 116CONFIG_FORCE_MAX_ZONEORDER=17
117CONFIG_SMP=y 117CONFIG_SMP=y
118CONFIG_NR_CPUS=512 118CONFIG_NR_CPUS=512
119CONFIG_IA64_NR_NODES=256
119CONFIG_HOTPLUG_CPU=y 120CONFIG_HOTPLUG_CPU=y
120# CONFIG_SCHED_SMT is not set 121# CONFIG_SCHED_SMT is not set
121# CONFIG_PREEMPT is not set 122# CONFIG_PREEMPT is not set
diff --git a/arch/ia64/dig/setup.c b/arch/ia64/dig/setup.c
index c9104bfff667..38aa9c108857 100644
--- a/arch/ia64/dig/setup.c
+++ b/arch/ia64/dig/setup.c
@@ -69,8 +69,3 @@ dig_setup (char **cmdline_p)
69 screen_info.orig_video_isVGA = 1; /* XXX fake */ 69 screen_info.orig_video_isVGA = 1; /* XXX fake */
70 screen_info.orig_video_ega_bx = 3; /* XXX fake */ 70 screen_info.orig_video_ega_bx = 3; /* XXX fake */
71} 71}
72
73void __init
74dig_irq_init (void)
75{
76}
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 4722ec51c70c..a4e218ce2edb 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -420,6 +420,26 @@ int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
420int __initdata nid_to_pxm_map[MAX_NUMNODES]; 420int __initdata nid_to_pxm_map[MAX_NUMNODES];
421static struct acpi_table_slit __initdata *slit_table; 421static struct acpi_table_slit __initdata *slit_table;
422 422
423static int get_processor_proximity_domain(struct acpi_table_processor_affinity *pa)
424{
425 int pxm;
426
427 pxm = pa->proximity_domain;
428 if (ia64_platform_is("sn2"))
429 pxm += pa->reserved[0] << 8;
430 return pxm;
431}
432
433static int get_memory_proximity_domain(struct acpi_table_memory_affinity *ma)
434{
435 int pxm;
436
437 pxm = ma->proximity_domain;
438 if (ia64_platform_is("sn2"))
439 pxm += ma->reserved1[0] << 8;
440 return pxm;
441}
442
423/* 443/*
424 * ACPI 2.0 SLIT (System Locality Information Table) 444 * ACPI 2.0 SLIT (System Locality Information Table)
425 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf 445 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
@@ -443,13 +463,20 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
443void __init 463void __init
444acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) 464acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
445{ 465{
466 int pxm;
467
468 if (!pa->flags.enabled)
469 return;
470
471 pxm = get_processor_proximity_domain(pa);
472
446 /* record this node in proximity bitmap */ 473 /* record this node in proximity bitmap */
447 pxm_bit_set(pa->proximity_domain); 474 pxm_bit_set(pxm);
448 475
449 node_cpuid[srat_num_cpus].phys_id = 476 node_cpuid[srat_num_cpus].phys_id =
450 (pa->apic_id << 8) | (pa->lsapic_eid); 477 (pa->apic_id << 8) | (pa->lsapic_eid);
451 /* nid should be overridden as logical node id later */ 478 /* nid should be overridden as logical node id later */
452 node_cpuid[srat_num_cpus].nid = pa->proximity_domain; 479 node_cpuid[srat_num_cpus].nid = pxm;
453 srat_num_cpus++; 480 srat_num_cpus++;
454} 481}
455 482
@@ -457,10 +484,10 @@ void __init
457acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) 484acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
458{ 485{
459 unsigned long paddr, size; 486 unsigned long paddr, size;
460 u8 pxm; 487 int pxm;
461 struct node_memblk_s *p, *q, *pend; 488 struct node_memblk_s *p, *q, *pend;
462 489
463 pxm = ma->proximity_domain; 490 pxm = get_memory_proximity_domain(ma);
464 491
465 /* fill node memory chunk structure */ 492 /* fill node memory chunk structure */
466 paddr = ma->base_addr_hi; 493 paddr = ma->base_addr_hi;
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index dcd906fe5749..829a43cab797 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -865,6 +865,7 @@ ENTRY(interrupt)
865 ;; 865 ;;
866 SAVE_REST 866 SAVE_REST
867 ;; 867 ;;
868 MCA_RECOVER_RANGE(interrupt)
868 alloc r14=ar.pfs,0,0,2,0 // must be first in an insn group 869 alloc r14=ar.pfs,0,0,2,0 // must be first in an insn group
869 mov out0=cr.ivr // pass cr.ivr as first arg 870 mov out0=cr.ivr // pass cr.ivr as first arg
870 add out1=16,sp // pass pointer to pt_regs as second arg 871 add out1=16,sp // pass pointer to pt_regs as second arg
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index c3a04ee7f4f6..4b0b71d5aef4 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -14,7 +14,15 @@
14struct ia64_machine_vector ia64_mv; 14struct ia64_machine_vector ia64_mv;
15EXPORT_SYMBOL(ia64_mv); 15EXPORT_SYMBOL(ia64_mv);
16 16
17static struct ia64_machine_vector * 17static __initdata const char *mvec_name;
18static __init int setup_mvec(char *s)
19{
20 mvec_name = s;
21 return 0;
22}
23early_param("machvec", setup_mvec);
24
25static struct ia64_machine_vector * __init
18lookup_machvec (const char *name) 26lookup_machvec (const char *name)
19{ 27{
20 extern struct ia64_machine_vector machvec_start[]; 28 extern struct ia64_machine_vector machvec_start[];
@@ -33,10 +41,13 @@ machvec_init (const char *name)
33{ 41{
34 struct ia64_machine_vector *mv; 42 struct ia64_machine_vector *mv;
35 43
44 if (!name)
45 name = mvec_name ? mvec_name : acpi_get_sysname();
36 mv = lookup_machvec(name); 46 mv = lookup_machvec(name);
37 if (!mv) { 47 if (!mv)
38 panic("generic kernel failed to find machine vector for platform %s!", name); 48 panic("generic kernel failed to find machine vector for"
39 } 49 " platform %s!", name);
50
40 ia64_mv = *mv; 51 ia64_mv = *mv;
41 printk(KERN_INFO "booting generic kernel on platform %s\n", name); 52 printk(KERN_INFO "booting generic kernel on platform %s\n", name);
42} 53}
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index b57e723f194c..87ff7fe33cfb 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -83,6 +83,7 @@
83#include <asm/irq.h> 83#include <asm/irq.h>
84#include <asm/hw_irq.h> 84#include <asm/hw_irq.h>
85 85
86#include "mca_drv.h"
86#include "entry.h" 87#include "entry.h"
87 88
88#if defined(IA64_MCA_DEBUG_INFO) 89#if defined(IA64_MCA_DEBUG_INFO)
@@ -133,7 +134,7 @@ static int cpe_poll_enabled = 1;
133 134
134extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe); 135extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe);
135 136
136static int mca_init; 137static int mca_init __initdata;
137 138
138 139
139static void inline 140static void inline
@@ -184,7 +185,7 @@ static ia64_state_log_t ia64_state_log[IA64_MAX_LOG_TYPES];
184 * Inputs : info_type (SAL_INFO_TYPE_{MCA,INIT,CMC,CPE}) 185 * Inputs : info_type (SAL_INFO_TYPE_{MCA,INIT,CMC,CPE})
185 * Outputs : None 186 * Outputs : None
186 */ 187 */
187static void 188static void __init
188ia64_log_init(int sal_info_type) 189ia64_log_init(int sal_info_type)
189{ 190{
190 u64 max_size = 0; 191 u64 max_size = 0;
@@ -281,6 +282,50 @@ ia64_mca_log_sal_error_record(int sal_info_type)
281 ia64_sal_clear_state_info(sal_info_type); 282 ia64_sal_clear_state_info(sal_info_type);
282} 283}
283 284
285/*
286 * search_mca_table
287 * See if the MCA surfaced in an instruction range
288 * that has been tagged as recoverable.
289 *
290 * Inputs
291 * first First address range to check
292 * last Last address range to check
293 * ip Instruction pointer, address we are looking for
294 *
295 * Return value:
296 * 1 on Success (in the table)/ 0 on Failure (not in the table)
297 */
298int
299search_mca_table (const struct mca_table_entry *first,
300 const struct mca_table_entry *last,
301 unsigned long ip)
302{
303 const struct mca_table_entry *curr;
304 u64 curr_start, curr_end;
305
306 curr = first;
307 while (curr <= last) {
308 curr_start = (u64) &curr->start_addr + curr->start_addr;
309 curr_end = (u64) &curr->end_addr + curr->end_addr;
310
311 if ((ip >= curr_start) && (ip <= curr_end)) {
312 return 1;
313 }
314 curr++;
315 }
316 return 0;
317}
318
319/* Given an address, look for it in the mca tables. */
320int mca_recover_range(unsigned long addr)
321{
322 extern struct mca_table_entry __start___mca_table[];
323 extern struct mca_table_entry __stop___mca_table[];
324
325 return search_mca_table(__start___mca_table, __stop___mca_table-1, addr);
326}
327EXPORT_SYMBOL_GPL(mca_recover_range);
328
284#ifdef CONFIG_ACPI 329#ifdef CONFIG_ACPI
285 330
286int cpe_vector = -1; 331int cpe_vector = -1;
@@ -355,7 +400,7 @@ ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
355 * Outputs 400 * Outputs
356 * None 401 * None
357 */ 402 */
358static void 403static void __init
359ia64_mca_register_cpev (int cpev) 404ia64_mca_register_cpev (int cpev)
360{ 405{
361 /* Register the CPE interrupt vector with SAL */ 406 /* Register the CPE interrupt vector with SAL */
@@ -386,7 +431,7 @@ ia64_mca_register_cpev (int cpev)
386 * Outputs 431 * Outputs
387 * None 432 * None
388 */ 433 */
389void 434void __cpuinit
390ia64_mca_cmc_vector_setup (void) 435ia64_mca_cmc_vector_setup (void)
391{ 436{
392 cmcv_reg_t cmcv; 437 cmcv_reg_t cmcv;
@@ -747,31 +792,34 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
747 ia64_mca_modify_comm(previous_current); 792 ia64_mca_modify_comm(previous_current);
748 goto no_mod; 793 goto no_mod;
749 } 794 }
750 if (r13 != sos->prev_IA64_KR_CURRENT) { 795
751 msg = "inconsistent previous current and r13"; 796 if (!mca_recover_range(ms->pmsa_iip)) {
752 goto no_mod; 797 if (r13 != sos->prev_IA64_KR_CURRENT) {
753 } 798 msg = "inconsistent previous current and r13";
754 if ((r12 - r13) >= KERNEL_STACK_SIZE) { 799 goto no_mod;
755 msg = "inconsistent r12 and r13"; 800 }
756 goto no_mod; 801 if ((r12 - r13) >= KERNEL_STACK_SIZE) {
757 } 802 msg = "inconsistent r12 and r13";
758 if ((ar_bspstore - r13) >= KERNEL_STACK_SIZE) { 803 goto no_mod;
759 msg = "inconsistent ar.bspstore and r13"; 804 }
760 goto no_mod; 805 if ((ar_bspstore - r13) >= KERNEL_STACK_SIZE) {
761 } 806 msg = "inconsistent ar.bspstore and r13";
762 va.p = old_bspstore; 807 goto no_mod;
763 if (va.f.reg < 5) { 808 }
764 msg = "old_bspstore is in the wrong region"; 809 va.p = old_bspstore;
765 goto no_mod; 810 if (va.f.reg < 5) {
766 } 811 msg = "old_bspstore is in the wrong region";
767 if ((ar_bsp - r13) >= KERNEL_STACK_SIZE) { 812 goto no_mod;
768 msg = "inconsistent ar.bsp and r13"; 813 }
769 goto no_mod; 814 if ((ar_bsp - r13) >= KERNEL_STACK_SIZE) {
770 } 815 msg = "inconsistent ar.bsp and r13";
771 size += (ia64_rse_skip_regs(old_bspstore, slots) - old_bspstore) * 8; 816 goto no_mod;
772 if (ar_bspstore + size > r12) { 817 }
773 msg = "no room for blocked state"; 818 size += (ia64_rse_skip_regs(old_bspstore, slots) - old_bspstore) * 8;
774 goto no_mod; 819 if (ar_bspstore + size > r12) {
820 msg = "no room for blocked state";
821 goto no_mod;
822 }
775 } 823 }
776 824
777 ia64_mca_modify_comm(previous_current); 825 ia64_mca_modify_comm(previous_current);
@@ -1443,7 +1491,7 @@ static struct irqaction mca_cpep_irqaction = {
1443 * format most of the fields. 1491 * format most of the fields.
1444 */ 1492 */
1445 1493
1446static void 1494static void __cpuinit
1447format_mca_init_stack(void *mca_data, unsigned long offset, 1495format_mca_init_stack(void *mca_data, unsigned long offset,
1448 const char *type, int cpu) 1496 const char *type, int cpu)
1449{ 1497{
@@ -1467,7 +1515,7 @@ format_mca_init_stack(void *mca_data, unsigned long offset,
1467 1515
1468/* Do per-CPU MCA-related initialization. */ 1516/* Do per-CPU MCA-related initialization. */
1469 1517
1470void __devinit 1518void __cpuinit
1471ia64_mca_cpu_init(void *cpu_data) 1519ia64_mca_cpu_init(void *cpu_data)
1472{ 1520{
1473 void *pal_vaddr; 1521 void *pal_vaddr;
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index e883d85906db..37c88eb55873 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -6,6 +6,7 @@
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) 6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com)
7 * Copyright (C) 2005 Silicon Graphics, Inc 7 * Copyright (C) 2005 Silicon Graphics, Inc
8 * Copyright (C) 2005 Keith Owens <kaos@sgi.com> 8 * Copyright (C) 2005 Keith Owens <kaos@sgi.com>
9 * Copyright (C) 2006 Russ Anderson <rja@sgi.com>
9 */ 10 */
10#include <linux/config.h> 11#include <linux/config.h>
11#include <linux/types.h> 12#include <linux/types.h>
@@ -121,11 +122,12 @@ mca_page_isolate(unsigned long paddr)
121 */ 122 */
122 123
123void 124void
124mca_handler_bh(unsigned long paddr) 125mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr)
125{ 126{
126 printk(KERN_ERR 127 printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, "
127 "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n", 128 "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n",
128 current->pid, current->comm, paddr); 129 raw_smp_processor_id(), current->pid, current->uid,
130 iip, ipsr, paddr, current->comm);
129 131
130 spin_lock(&mca_bh_lock); 132 spin_lock(&mca_bh_lock);
131 switch (mca_page_isolate(paddr)) { 133 switch (mca_page_isolate(paddr)) {
@@ -442,21 +444,26 @@ recover_from_read_error(slidx_table_t *slidx,
442 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate)) 444 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate))
443 return 0; 445 return 0;
444 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); 446 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr);
447 psr2 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_xpsr);
445 448
446 /* 449 /*
447 * Check the privilege level of interrupted context. 450 * Check the privilege level of interrupted context.
448 * If it is user-mode, then terminate affected process. 451 * If it is user-mode, then terminate affected process.
449 */ 452 */
450 if (psr1->cpl != 0) { 453
454 pmsa = sos->pal_min_state;
455 if (psr1->cpl != 0 ||
456 ((psr2->cpl != 0) && mca_recover_range(pmsa->pmsa_iip))) {
451 smei = peidx_bus_check(peidx, 0); 457 smei = peidx_bus_check(peidx, 0);
452 if (smei->valid.target_identifier) { 458 if (smei->valid.target_identifier) {
453 /* 459 /*
454 * setup for resume to bottom half of MCA, 460 * setup for resume to bottom half of MCA,
455 * "mca_handler_bhhook" 461 * "mca_handler_bhhook"
456 */ 462 */
457 pmsa = sos->pal_min_state; 463 /* pass to bhhook as argument (gr8, ...) */
458 /* pass to bhhook as 1st argument (gr8) */
459 pmsa->pmsa_gr[8-1] = smei->target_identifier; 464 pmsa->pmsa_gr[8-1] = smei->target_identifier;
465 pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip;
466 pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr;
460 /* set interrupted return address (but no use) */ 467 /* set interrupted return address (but no use) */
461 pmsa->pmsa_br0 = pmsa->pmsa_iip; 468 pmsa->pmsa_br0 = pmsa->pmsa_iip;
462 /* change resume address to bottom half */ 469 /* change resume address to bottom half */
@@ -466,6 +473,7 @@ recover_from_read_error(slidx_table_t *slidx,
466 psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr; 473 psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr;
467 psr2->cpl = 0; 474 psr2->cpl = 0;
468 psr2->ri = 0; 475 psr2->ri = 0;
476 psr2->bn = 1;
469 psr2->i = 0; 477 psr2->i = 0;
470 478
471 return 1; 479 return 1;
diff --git a/arch/ia64/kernel/mca_drv.h b/arch/ia64/kernel/mca_drv.h
index e2f6fa1e0ef6..31a2e52bb16f 100644
--- a/arch/ia64/kernel/mca_drv.h
+++ b/arch/ia64/kernel/mca_drv.h
@@ -111,3 +111,10 @@ typedef struct slidx_table {
111 slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\ 111 slidx_foreach_entry(__pos, &((slidx)->sec)) { __count++; }\
112 __count; }) 112 __count; })
113 113
114struct mca_table_entry {
115 int start_addr; /* location-relative starting address of MCA recoverable range */
116 int end_addr; /* location-relative ending address of MCA recoverable range */
117};
118
119extern const struct mca_table_entry *search_mca_tables (unsigned long addr);
120extern int mca_recover_range(unsigned long);
diff --git a/arch/ia64/kernel/mca_drv_asm.S b/arch/ia64/kernel/mca_drv_asm.S
index 3f298ee4d00c..e6a580d354b9 100644
--- a/arch/ia64/kernel/mca_drv_asm.S
+++ b/arch/ia64/kernel/mca_drv_asm.S
@@ -14,15 +14,12 @@
14 14
15GLOBAL_ENTRY(mca_handler_bhhook) 15GLOBAL_ENTRY(mca_handler_bhhook)
16 invala // clear RSE ? 16 invala // clear RSE ?
17 ;;
18 cover 17 cover
19 ;; 18 ;;
20 clrrrb 19 clrrrb
21 ;; 20 ;;
22 alloc r16=ar.pfs,0,2,1,0 // make a new frame 21 alloc r16=ar.pfs,0,2,3,0 // make a new frame
23 ;;
24 mov ar.rsc=0 22 mov ar.rsc=0
25 ;;
26 mov r13=IA64_KR(CURRENT) // current task pointer 23 mov r13=IA64_KR(CURRENT) // current task pointer
27 ;; 24 ;;
28 mov r2=r13 25 mov r2=r13
@@ -30,7 +27,6 @@ GLOBAL_ENTRY(mca_handler_bhhook)
30 addl r22=IA64_RBS_OFFSET,r2 27 addl r22=IA64_RBS_OFFSET,r2
31 ;; 28 ;;
32 mov ar.bspstore=r22 29 mov ar.bspstore=r22
33 ;;
34 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 30 addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2
35 ;; 31 ;;
36 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 32 adds r2=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
@@ -40,12 +36,12 @@ GLOBAL_ENTRY(mca_handler_bhhook)
40 movl loc1=mca_handler_bh // recovery C function 36 movl loc1=mca_handler_bh // recovery C function
41 ;; 37 ;;
42 mov out0=r8 // poisoned address 38 mov out0=r8 // poisoned address
39 mov out1=r9 // iip
40 mov out2=r10 // psr
43 mov b6=loc1 41 mov b6=loc1
44 ;; 42 ;;
45 mov loc1=rp 43 mov loc1=rp
46 ;; 44 ssm psr.i | psr.ic
47 ssm psr.i
48 ;;
49 br.call.sptk.many rp=b6 // does not return ... 45 br.call.sptk.many rp=b6 // does not return ...
50 ;; 46 ;;
51 mov ar.pfs=loc0 47 mov ar.pfs=loc0
@@ -53,5 +49,4 @@ GLOBAL_ENTRY(mca_handler_bhhook)
53 ;; 49 ;;
54 mov r8=r0 50 mov r8=r0
55 br.ret.sptk.many rp 51 br.ret.sptk.many rp
56 ;;
57END(mca_handler_bhhook) 52END(mca_handler_bhhook)
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
index a68ce6678092..0766493d4d00 100644
--- a/arch/ia64/kernel/numa.c
+++ b/arch/ia64/kernel/numa.c
@@ -25,7 +25,7 @@
25#include <asm/processor.h> 25#include <asm/processor.h>
26#include <asm/smp.h> 26#include <asm/smp.h>
27 27
28u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned; 28u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
29EXPORT_SYMBOL(cpu_to_node_map); 29EXPORT_SYMBOL(cpu_to_node_map);
30 30
31cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; 31cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
diff --git a/arch/ia64/kernel/patch.c b/arch/ia64/kernel/patch.c
index 6a4ac7d70b35..bc11bb096f58 100644
--- a/arch/ia64/kernel/patch.c
+++ b/arch/ia64/kernel/patch.c
@@ -115,7 +115,7 @@ ia64_patch_vtop (unsigned long start, unsigned long end)
115 ia64_srlz_i(); 115 ia64_srlz_i();
116} 116}
117 117
118void 118void __init
119ia64_patch_mckinley_e9 (unsigned long start, unsigned long end) 119ia64_patch_mckinley_e9 (unsigned long start, unsigned long end)
120{ 120{
121 static int first_time = 1; 121 static int first_time = 1;
@@ -149,7 +149,7 @@ ia64_patch_mckinley_e9 (unsigned long start, unsigned long end)
149 ia64_srlz_i(); 149 ia64_srlz_i();
150} 150}
151 151
152static void 152static void __init
153patch_fsyscall_table (unsigned long start, unsigned long end) 153patch_fsyscall_table (unsigned long start, unsigned long end)
154{ 154{
155 extern unsigned long fsyscall_table[NR_syscalls]; 155 extern unsigned long fsyscall_table[NR_syscalls];
@@ -166,7 +166,7 @@ patch_fsyscall_table (unsigned long start, unsigned long end)
166 ia64_srlz_i(); 166 ia64_srlz_i();
167} 167}
168 168
169static void 169static void __init
170patch_brl_fsys_bubble_down (unsigned long start, unsigned long end) 170patch_brl_fsys_bubble_down (unsigned long start, unsigned long end)
171{ 171{
172 extern char fsys_bubble_down[]; 172 extern char fsys_bubble_down[];
@@ -184,7 +184,7 @@ patch_brl_fsys_bubble_down (unsigned long start, unsigned long end)
184 ia64_srlz_i(); 184 ia64_srlz_i();
185} 185}
186 186
187void 187void __init
188ia64_patch_gate (void) 188ia64_patch_gate (void)
189{ 189{
190# define START(name) ((unsigned long) __start_gate_##name##_patchlist) 190# define START(name) ((unsigned long) __start_gate_##name##_patchlist)
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 958c1508036f..eb388e271b2b 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -130,8 +130,8 @@ EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
130/* 130/*
131 * We use a special marker for the end of memory and it uses the extra (+1) slot 131 * We use a special marker for the end of memory and it uses the extra (+1) slot
132 */ 132 */
133struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1]; 133struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1] __initdata;
134int num_rsvd_regions; 134int num_rsvd_regions __initdata;
135 135
136 136
137/* 137/*
@@ -140,7 +140,7 @@ int num_rsvd_regions;
140 * caller-specified function is called with the memory ranges that remain after filtering. 140 * caller-specified function is called with the memory ranges that remain after filtering.
141 * This routine does not assume the incoming segments are sorted. 141 * This routine does not assume the incoming segments are sorted.
142 */ 142 */
143int 143int __init
144filter_rsvd_memory (unsigned long start, unsigned long end, void *arg) 144filter_rsvd_memory (unsigned long start, unsigned long end, void *arg)
145{ 145{
146 unsigned long range_start, range_end, prev_start; 146 unsigned long range_start, range_end, prev_start;
@@ -176,7 +176,7 @@ filter_rsvd_memory (unsigned long start, unsigned long end, void *arg)
176 return 0; 176 return 0;
177} 177}
178 178
179static void 179static void __init
180sort_regions (struct rsvd_region *rsvd_region, int max) 180sort_regions (struct rsvd_region *rsvd_region, int max)
181{ 181{
182 int j; 182 int j;
@@ -217,7 +217,7 @@ __initcall(register_memory);
217 * initrd, etc. There are currently %IA64_MAX_RSVD_REGIONS defined, 217 * initrd, etc. There are currently %IA64_MAX_RSVD_REGIONS defined,
218 * see include/asm-ia64/meminit.h if you need to define more. 218 * see include/asm-ia64/meminit.h if you need to define more.
219 */ 219 */
220void 220void __init
221reserve_memory (void) 221reserve_memory (void)
222{ 222{
223 int n = 0; 223 int n = 0;
@@ -269,7 +269,7 @@ reserve_memory (void)
269 * Grab the initrd start and end from the boot parameter struct given us by 269 * Grab the initrd start and end from the boot parameter struct given us by
270 * the boot loader. 270 * the boot loader.
271 */ 271 */
272void 272void __init
273find_initrd (void) 273find_initrd (void)
274{ 274{
275#ifdef CONFIG_BLK_DEV_INITRD 275#ifdef CONFIG_BLK_DEV_INITRD
@@ -361,7 +361,7 @@ mark_bsp_online (void)
361} 361}
362 362
363#ifdef CONFIG_SMP 363#ifdef CONFIG_SMP
364static void 364static void __init
365check_for_logical_procs (void) 365check_for_logical_procs (void)
366{ 366{
367 pal_logical_to_physical_t info; 367 pal_logical_to_physical_t info;
@@ -388,6 +388,14 @@ check_for_logical_procs (void)
388} 388}
389#endif 389#endif
390 390
391static __initdata int nomca;
392static __init int setup_nomca(char *s)
393{
394 nomca = 1;
395 return 0;
396}
397early_param("nomca", setup_nomca);
398
391void __init 399void __init
392setup_arch (char **cmdline_p) 400setup_arch (char **cmdline_p)
393{ 401{
@@ -401,35 +409,15 @@ setup_arch (char **cmdline_p)
401 efi_init(); 409 efi_init();
402 io_port_init(); 410 io_port_init();
403 411
412 parse_early_param();
413
404#ifdef CONFIG_IA64_GENERIC 414#ifdef CONFIG_IA64_GENERIC
405 { 415 machvec_init(NULL);
406 const char *mvec_name = strstr (*cmdline_p, "machvec=");
407 char str[64];
408
409 if (mvec_name) {
410 const char *end;
411 size_t len;
412
413 mvec_name += 8;
414 end = strchr (mvec_name, ' ');
415 if (end)
416 len = end - mvec_name;
417 else
418 len = strlen (mvec_name);
419 len = min(len, sizeof (str) - 1);
420 strncpy (str, mvec_name, len);
421 str[len] = '\0';
422 mvec_name = str;
423 } else
424 mvec_name = acpi_get_sysname();
425 machvec_init(mvec_name);
426 }
427#endif 416#endif
428 417
429 if (early_console_setup(*cmdline_p) == 0) 418 if (early_console_setup(*cmdline_p) == 0)
430 mark_bsp_online(); 419 mark_bsp_online();
431 420
432 parse_early_param();
433#ifdef CONFIG_ACPI 421#ifdef CONFIG_ACPI
434 /* Initialize the ACPI boot-time table parser */ 422 /* Initialize the ACPI boot-time table parser */
435 acpi_table_init(); 423 acpi_table_init();
@@ -492,7 +480,7 @@ setup_arch (char **cmdline_p)
492#endif 480#endif
493 481
494 /* enable IA-64 Machine Check Abort Handling unless disabled */ 482 /* enable IA-64 Machine Check Abort Handling unless disabled */
495 if (!strstr(saved_command_line, "nomca")) 483 if (!nomca)
496 ia64_mca_init(); 484 ia64_mca_init();
497 485
498 platform_setup(cmdline_p); 486 platform_setup(cmdline_p);
@@ -622,7 +610,7 @@ struct seq_operations cpuinfo_op = {
622 .show = show_cpuinfo 610 .show = show_cpuinfo
623}; 611};
624 612
625void 613static void __cpuinit
626identify_cpu (struct cpuinfo_ia64 *c) 614identify_cpu (struct cpuinfo_ia64 *c)
627{ 615{
628 union { 616 union {
@@ -699,7 +687,7 @@ setup_per_cpu_areas (void)
699 * In addition, the minimum of the i-cache stride sizes is calculated for 687 * In addition, the minimum of the i-cache stride sizes is calculated for
700 * "flush_icache_range()". 688 * "flush_icache_range()".
701 */ 689 */
702static void 690static void __cpuinit
703get_max_cacheline_size (void) 691get_max_cacheline_size (void)
704{ 692{
705 unsigned long line_size, max = 1; 693 unsigned long line_size, max = 1;
@@ -762,10 +750,10 @@ get_max_cacheline_size (void)
762 * cpu_init() initializes state that is per-CPU. This function acts 750 * cpu_init() initializes state that is per-CPU. This function acts
763 * as a 'CPU state barrier', nothing should get across. 751 * as a 'CPU state barrier', nothing should get across.
764 */ 752 */
765void 753void __cpuinit
766cpu_init (void) 754cpu_init (void)
767{ 755{
768 extern void __devinit ia64_mmu_init (void *); 756 extern void __cpuinit ia64_mmu_init (void *);
769 unsigned long num_phys_stacked; 757 unsigned long num_phys_stacked;
770 pal_vm_info_2_u_t vmi; 758 pal_vm_info_2_u_t vmi;
771 unsigned int max_ctx; 759 unsigned int max_ctx;
@@ -893,7 +881,7 @@ void sched_cacheflush(void)
893 ia64_sal_cache_flush(3); 881 ia64_sal_cache_flush(3);
894} 882}
895 883
896void 884void __init
897check_bugs (void) 885check_bugs (void)
898{ 886{
899 ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles, 887 ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index c4b633b36dab..44e9547878ac 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -624,32 +624,8 @@ void __devinit smp_prepare_boot_cpu(void)
624 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 624 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
625} 625}
626 626
627/*
628 * mt_info[] is a temporary store for all info returned by
629 * PAL_LOGICAL_TO_PHYSICAL, to be copied into cpuinfo_ia64 when the
630 * specific cpu comes.
631 */
632static struct {
633 __u32 socket_id;
634 __u16 core_id;
635 __u16 thread_id;
636 __u16 proc_fixed_addr;
637 __u8 valid;
638} mt_info[NR_CPUS] __devinitdata;
639
640#ifdef CONFIG_HOTPLUG_CPU 627#ifdef CONFIG_HOTPLUG_CPU
641static inline void 628static inline void
642remove_from_mtinfo(int cpu)
643{
644 int i;
645
646 for_each_cpu(i)
647 if (mt_info[i].valid && mt_info[i].socket_id ==
648 cpu_data(cpu)->socket_id)
649 mt_info[i].valid = 0;
650}
651
652static inline void
653clear_cpu_sibling_map(int cpu) 629clear_cpu_sibling_map(int cpu)
654{ 630{
655 int i; 631 int i;
@@ -678,12 +654,6 @@ remove_siblinginfo(int cpu)
678 654
679 /* remove it from all sibling map's */ 655 /* remove it from all sibling map's */
680 clear_cpu_sibling_map(cpu); 656 clear_cpu_sibling_map(cpu);
681
682 /* if this cpu is the last in the core group, remove all its info
683 * from mt_info structure
684 */
685 if (last)
686 remove_from_mtinfo(cpu);
687} 657}
688 658
689extern void fixup_irqs(void); 659extern void fixup_irqs(void);
@@ -878,40 +848,6 @@ init_smp_config(void)
878 ia64_sal_strerror(sal_ret)); 848 ia64_sal_strerror(sal_ret));
879} 849}
880 850
881static inline int __devinit
882check_for_mtinfo_index(void)
883{
884 int i;
885
886 for_each_cpu(i)
887 if (!mt_info[i].valid)
888 return i;
889
890 return -1;
891}
892
893/*
894 * Search the mt_info to find out if this socket's cid/tid information is
895 * cached or not. If the socket exists, fill in the core_id and thread_id
896 * in cpuinfo
897 */
898static int __devinit
899check_for_new_socket(__u16 logical_address, struct cpuinfo_ia64 *c)
900{
901 int i;
902 __u32 sid = c->socket_id;
903
904 for_each_cpu(i) {
905 if (mt_info[i].valid && mt_info[i].proc_fixed_addr == logical_address
906 && mt_info[i].socket_id == sid) {
907 c->core_id = mt_info[i].core_id;
908 c->thread_id = mt_info[i].thread_id;
909 return 1; /* not a new socket */
910 }
911 }
912 return 0;
913}
914
915/* 851/*
916 * identify_siblings(cpu) gets called from identify_cpu. This populates the 852 * identify_siblings(cpu) gets called from identify_cpu. This populates the
917 * information related to logical execution units in per_cpu_data structure. 853 * information related to logical execution units in per_cpu_data structure.
@@ -921,14 +857,12 @@ identify_siblings(struct cpuinfo_ia64 *c)
921{ 857{
922 s64 status; 858 s64 status;
923 u16 pltid; 859 u16 pltid;
924 u64 proc_fixed_addr;
925 int count, i;
926 pal_logical_to_physical_t info; 860 pal_logical_to_physical_t info;
927 861
928 if (smp_num_cpucores == 1 && smp_num_siblings == 1) 862 if (smp_num_cpucores == 1 && smp_num_siblings == 1)
929 return; 863 return;
930 864
931 if ((status = ia64_pal_logical_to_phys(0, &info)) != PAL_STATUS_SUCCESS) { 865 if ((status = ia64_pal_logical_to_phys(-1, &info)) != PAL_STATUS_SUCCESS) {
932 printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n", 866 printk(KERN_ERR "ia64_pal_logical_to_phys failed with %ld\n",
933 status); 867 status);
934 return; 868 return;
@@ -937,47 +871,12 @@ identify_siblings(struct cpuinfo_ia64 *c)
937 printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status); 871 printk(KERN_ERR "ia64_sal_pltid failed with %ld\n", status);
938 return; 872 return;
939 } 873 }
940 if ((status = ia64_pal_fixed_addr(&proc_fixed_addr)) != PAL_STATUS_SUCCESS) {
941 printk(KERN_ERR "ia64_pal_fixed_addr failed with %ld\n", status);
942 return;
943 }
944 874
945 c->socket_id = (pltid << 8) | info.overview_ppid; 875 c->socket_id = (pltid << 8) | info.overview_ppid;
946 c->cores_per_socket = info.overview_cpp; 876 c->cores_per_socket = info.overview_cpp;
947 c->threads_per_core = info.overview_tpc; 877 c->threads_per_core = info.overview_tpc;
948 count = c->num_log = info.overview_num_log; 878 c->num_log = info.overview_num_log;
949 879
950 /* If the thread and core id information is already cached, then 880 c->core_id = info.log1_cid;
951 * we will simply update cpu_info and return. Otherwise, we will 881 c->thread_id = info.log1_tid;
952 * do the PAL calls and cache core and thread id's of all the siblings.
953 */
954 if (check_for_new_socket(proc_fixed_addr, c))
955 return;
956
957 for (i = 0; i < count; i++) {
958 int index;
959
960 if (i && (status = ia64_pal_logical_to_phys(i, &info))
961 != PAL_STATUS_SUCCESS) {
962 printk(KERN_ERR "ia64_pal_logical_to_phys failed"
963 " with %ld\n", status);
964 return;
965 }
966 if (info.log2_la == proc_fixed_addr) {
967 c->core_id = info.log1_cid;
968 c->thread_id = info.log1_tid;
969 }
970
971 index = check_for_mtinfo_index();
972 /* We will not do the mt_info caching optimization in this case.
973 */
974 if (index < 0)
975 continue;
976
977 mt_info[index].valid = 1;
978 mt_info[index].socket_id = c->socket_id;
979 mt_info[index].core_id = info.log1_cid;
980 mt_info[index].thread_id = info.log1_tid;
981 mt_info[index].proc_fixed_addr = info.log2_la;
982 }
983} 882}
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 73af6267d2ef..0b9e56dd7f05 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -70,34 +70,9 @@ SECTIONS
70 __stop___ex_table = .; 70 __stop___ex_table = .;
71 } 71 }
72 72
73 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
74 {
75 __start___vtop_patchlist = .;
76 *(.data.patch.vtop)
77 __end___vtop_patchlist = .;
78 }
79
80 .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
81 {
82 __start___mckinley_e9_bundles = .;
83 *(.data.patch.mckinley_e9)
84 __end___mckinley_e9_bundles = .;
85 }
86
87 /* Global data */ 73 /* Global data */
88 _data = .; 74 _data = .;
89 75
90#if defined(CONFIG_IA64_GENERIC)
91 /* Machine Vector */
92 . = ALIGN(16);
93 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
94 {
95 machvec_start = .;
96 *(.machvec)
97 machvec_end = .;
98 }
99#endif
100
101 /* Unwind info & table: */ 76 /* Unwind info & table: */
102 . = ALIGN(8); 77 . = ALIGN(8);
103 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET) 78 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
@@ -154,6 +129,41 @@ SECTIONS
154 *(.initcall7.init) 129 *(.initcall7.init)
155 __initcall_end = .; 130 __initcall_end = .;
156 } 131 }
132
133 /* MCA table */
134 . = ALIGN(16);
135 __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
136 {
137 __start___mca_table = .;
138 *(__mca_table)
139 __stop___mca_table = .;
140 }
141
142 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
143 {
144 __start___vtop_patchlist = .;
145 *(.data.patch.vtop)
146 __end___vtop_patchlist = .;
147 }
148
149 .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
150 {
151 __start___mckinley_e9_bundles = .;
152 *(.data.patch.mckinley_e9)
153 __end___mckinley_e9_bundles = .;
154 }
155
156#if defined(CONFIG_IA64_GENERIC)
157 /* Machine Vector */
158 . = ALIGN(16);
159 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
160 {
161 machvec_start = .;
162 *(.machvec)
163 machvec_end = .;
164 }
165#endif
166
157 __con_initcall_start = .; 167 __con_initcall_start = .;
158 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) 168 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
159 { *(.con_initcall.init) } 169 { *(.con_initcall.init) }
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index 9855ba318094..84fd1c14c8a9 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -97,7 +97,7 @@ find_max_pfn (unsigned long start, unsigned long end, void *arg)
97 * Find a place to put the bootmap and return its starting address in 97 * Find a place to put the bootmap and return its starting address in
98 * bootmap_start. This address must be page-aligned. 98 * bootmap_start. This address must be page-aligned.
99 */ 99 */
100int 100static int __init
101find_bootmap_location (unsigned long start, unsigned long end, void *arg) 101find_bootmap_location (unsigned long start, unsigned long end, void *arg)
102{ 102{
103 unsigned long needed = *(unsigned long *)arg; 103 unsigned long needed = *(unsigned long *)arg;
@@ -141,7 +141,7 @@ find_bootmap_location (unsigned long start, unsigned long end, void *arg)
141 * Walk the EFI memory map and find usable memory for the system, taking 141 * Walk the EFI memory map and find usable memory for the system, taking
142 * into account reserved areas. 142 * into account reserved areas.
143 */ 143 */
144void 144void __init
145find_memory (void) 145find_memory (void)
146{ 146{
147 unsigned long bootmap_size; 147 unsigned long bootmap_size;
@@ -176,7 +176,7 @@ find_memory (void)
176 * 176 *
177 * Allocate and setup per-cpu data areas. 177 * Allocate and setup per-cpu data areas.
178 */ 178 */
179void * 179void * __cpuinit
180per_cpu_init (void) 180per_cpu_init (void)
181{ 181{
182 void *cpu_data; 182 void *cpu_data;
@@ -228,7 +228,7 @@ count_dma_pages (u64 start, u64 end, void *arg)
228 * Set up the page tables. 228 * Set up the page tables.
229 */ 229 */
230 230
231void 231void __init
232paging_init (void) 232paging_init (void)
233{ 233{
234 unsigned long max_dma; 234 unsigned long max_dma;
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 573d5cc63e2b..2f5e44862e91 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -525,7 +525,7 @@ void __init find_memory(void)
525 * find_pernode_space() does most of this already, we just need to set 525 * find_pernode_space() does most of this already, we just need to set
526 * local_per_cpu_offset 526 * local_per_cpu_offset
527 */ 527 */
528void *per_cpu_init(void) 528void __cpuinit *per_cpu_init(void)
529{ 529{
530 int cpu; 530 int cpu;
531 static int first_time = 1; 531 static int first_time = 1;
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 9dbc7dadd165..8d506710fdbd 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -113,8 +113,7 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
113 unsigned long floor, unsigned long ceiling) 113 unsigned long floor, unsigned long ceiling)
114{ 114{
115 /* 115 /*
116 * This is called only when is_hugepage_only_range(addr,), 116 * This is called to free hugetlb page tables.
117 * and it follows that is_hugepage_only_range(end,) also.
118 * 117 *
119 * The offset of these addresses from the base of the hugetlb 118 * The offset of these addresses from the base of the hugetlb
120 * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that 119 * region must be scaled down by HPAGE_SIZE/PAGE_SIZE so that
@@ -126,9 +125,9 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
126 125
127 addr = htlbpage_to_page(addr); 126 addr = htlbpage_to_page(addr);
128 end = htlbpage_to_page(end); 127 end = htlbpage_to_page(end);
129 if (is_hugepage_only_range(tlb->mm, floor, HPAGE_SIZE)) 128 if (REGION_NUMBER(floor) == RGN_HPAGE)
130 floor = htlbpage_to_page(floor); 129 floor = htlbpage_to_page(floor);
131 if (is_hugepage_only_range(tlb->mm, ceiling, HPAGE_SIZE)) 130 if (REGION_NUMBER(ceiling) == RGN_HPAGE)
132 ceiling = htlbpage_to_page(ceiling); 131 ceiling = htlbpage_to_page(ceiling);
133 132
134 free_pgd_range(tlb, addr, end, floor, ceiling); 133 free_pgd_range(tlb, addr, end, floor, ceiling);
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 08d94e6bfa18..ff4f31fcd330 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -206,7 +206,7 @@ free_initmem (void)
206 (__init_end - __init_begin) >> 10); 206 (__init_end - __init_begin) >> 10);
207} 207}
208 208
209void 209void __init
210free_initrd_mem (unsigned long start, unsigned long end) 210free_initrd_mem (unsigned long start, unsigned long end)
211{ 211{
212 struct page *page; 212 struct page *page;
@@ -261,7 +261,7 @@ free_initrd_mem (unsigned long start, unsigned long end)
261/* 261/*
262 * This installs a clean page in the kernel's page table. 262 * This installs a clean page in the kernel's page table.
263 */ 263 */
264struct page * 264static struct page * __init
265put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot) 265put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
266{ 266{
267 pgd_t *pgd; 267 pgd_t *pgd;
@@ -294,7 +294,7 @@ put_kernel_page (struct page *page, unsigned long address, pgprot_t pgprot)
294 return page; 294 return page;
295} 295}
296 296
297static void 297static void __init
298setup_gate (void) 298setup_gate (void)
299{ 299{
300 struct page *page; 300 struct page *page;
@@ -411,7 +411,7 @@ ia64_mmu_init (void *my_cpu_data)
411 411
412#ifdef CONFIG_VIRTUAL_MEM_MAP 412#ifdef CONFIG_VIRTUAL_MEM_MAP
413 413
414int 414int __init
415create_mem_map_page_table (u64 start, u64 end, void *arg) 415create_mem_map_page_table (u64 start, u64 end, void *arg)
416{ 416{
417 unsigned long address, start_page, end_page; 417 unsigned long address, start_page, end_page;
@@ -519,7 +519,7 @@ ia64_pfn_valid (unsigned long pfn)
519} 519}
520EXPORT_SYMBOL(ia64_pfn_valid); 520EXPORT_SYMBOL(ia64_pfn_valid);
521 521
522int 522int __init
523find_largest_hole (u64 start, u64 end, void *arg) 523find_largest_hole (u64 start, u64 end, void *arg)
524{ 524{
525 u64 *max_gap = arg; 525 u64 *max_gap = arg;
@@ -535,7 +535,7 @@ find_largest_hole (u64 start, u64 end, void *arg)
535} 535}
536#endif /* CONFIG_VIRTUAL_MEM_MAP */ 536#endif /* CONFIG_VIRTUAL_MEM_MAP */
537 537
538static int 538static int __init
539count_reserved_pages (u64 start, u64 end, void *arg) 539count_reserved_pages (u64 start, u64 end, void *arg)
540{ 540{
541 unsigned long num_reserved = 0; 541 unsigned long num_reserved = 0;
@@ -556,7 +556,7 @@ count_reserved_pages (u64 start, u64 end, void *arg)
556 * purposes. 556 * purposes.
557 */ 557 */
558 558
559static int nolwsys; 559static int nolwsys __initdata;
560 560
561static int __init 561static int __init
562nolwsys_setup (char *s) 562nolwsys_setup (char *s)
@@ -567,7 +567,7 @@ nolwsys_setup (char *s)
567 567
568__setup("nolwsys", nolwsys_setup); 568__setup("nolwsys", nolwsys_setup);
569 569
570void 570void __init
571mem_init (void) 571mem_init (void)
572{ 572{
573 long reserved_pages, codesize, datasize, initsize; 573 long reserved_pages, codesize, datasize, initsize;
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index dfb3f2902379..5101ac462643 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -13,6 +13,8 @@
13#include <asm/sn/sn_feature_sets.h> 13#include <asm/sn/sn_feature_sets.h>
14#include <asm/sn/geo.h> 14#include <asm/sn/geo.h>
15#include <asm/sn/io.h> 15#include <asm/sn/io.h>
16#include <asm/sn/l1.h>
17#include <asm/sn/module.h>
16#include <asm/sn/pcibr_provider.h> 18#include <asm/sn/pcibr_provider.h>
17#include <asm/sn/pcibus_provider_defs.h> 19#include <asm/sn/pcibus_provider_defs.h>
18#include <asm/sn/pcidev.h> 20#include <asm/sn/pcidev.h>
@@ -710,9 +712,36 @@ cnodeid_get_geoid(cnodeid_t cnode)
710 return hubdev->hdi_geoid; 712 return hubdev->hdi_geoid;
711} 713}
712 714
715void sn_generate_path(struct pci_bus *pci_bus, char *address)
716{
717 nasid_t nasid;
718 cnodeid_t cnode;
719 geoid_t geoid;
720 moduleid_t moduleid;
721 u16 bricktype;
722
723 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
724 cnode = nasid_to_cnodeid(nasid);
725 geoid = cnodeid_get_geoid(cnode);
726 moduleid = geo_module(geoid);
727
728 sprintf(address, "module_%c%c%c%c%.2d",
729 '0'+RACK_GET_CLASS(MODULE_GET_RACK(moduleid)),
730 '0'+RACK_GET_GROUP(MODULE_GET_RACK(moduleid)),
731 '0'+RACK_GET_NUM(MODULE_GET_RACK(moduleid)),
732 MODULE_GET_BTCHAR(moduleid), MODULE_GET_BPOS(moduleid));
733
734 /* Tollhouse requires slot id to be displayed */
735 bricktype = MODULE_GET_BTYPE(moduleid);
736 if ((bricktype == L1_BRICKTYPE_191010) ||
737 (bricktype == L1_BRICKTYPE_1932))
738 sprintf(address, "%s^%d", address, geo_slot(geoid));
739}
740
713subsys_initcall(sn_pci_init); 741subsys_initcall(sn_pci_init);
714EXPORT_SYMBOL(sn_pci_fixup_slot); 742EXPORT_SYMBOL(sn_pci_fixup_slot);
715EXPORT_SYMBOL(sn_pci_unfixup_slot); 743EXPORT_SYMBOL(sn_pci_unfixup_slot);
716EXPORT_SYMBOL(sn_pci_controller_fixup); 744EXPORT_SYMBOL(sn_pci_controller_fixup);
717EXPORT_SYMBOL(sn_bus_store_sysdata); 745EXPORT_SYMBOL(sn_bus_store_sysdata);
718EXPORT_SYMBOL(sn_bus_free_sysdata); 746EXPORT_SYMBOL(sn_bus_free_sysdata);
747EXPORT_SYMBOL(sn_generate_path);
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index c373113d073a..c265e02f5036 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -350,9 +350,6 @@ static void force_interrupt(int irq)
350static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info) 350static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
351{ 351{
352 u64 regval; 352 u64 regval;
353 int irr_reg_num;
354 int irr_bit;
355 u64 irr_reg;
356 struct pcidev_info *pcidev_info; 353 struct pcidev_info *pcidev_info;
357 struct pcibus_info *pcibus_info; 354 struct pcibus_info *pcibus_info;
358 355
@@ -373,23 +370,7 @@ static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
373 pdi_pcibus_info; 370 pdi_pcibus_info;
374 regval = pcireg_intr_status_get(pcibus_info); 371 regval = pcireg_intr_status_get(pcibus_info);
375 372
376 irr_reg_num = irq_to_vector(irq) / 64; 373 if (!ia64_get_irr(irq_to_vector(irq))) {
377 irr_bit = irq_to_vector(irq) % 64;
378 switch (irr_reg_num) {
379 case 0:
380 irr_reg = ia64_getreg(_IA64_REG_CR_IRR0);
381 break;
382 case 1:
383 irr_reg = ia64_getreg(_IA64_REG_CR_IRR1);
384 break;
385 case 2:
386 irr_reg = ia64_getreg(_IA64_REG_CR_IRR2);
387 break;
388 case 3:
389 irr_reg = ia64_getreg(_IA64_REG_CR_IRR3);
390 break;
391 }
392 if (!test_bit(irr_bit, &irr_reg)) {
393 if (!test_bit(irq, pda->sn_in_service_ivecs)) { 374 if (!test_bit(irq, pda->sn_in_service_ivecs)) {
394 regval &= 0xff; 375 regval &= 0xff;
395 if (sn_irq_info->irq_int_bit & regval & 376 if (sn_irq_info->irq_int_bit & regval &
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 99cb28e74295..feaf1a6e8101 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -369,9 +369,15 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)
369 369
370static int is_fpga_tio(int nasid, int *bt) 370static int is_fpga_tio(int nasid, int *bt)
371{ 371{
372 int ioboard_type; 372 u16 ioboard_type;
373 s64 rc;
373 374
374 ioboard_type = ia64_sn_sysctl_ioboard_get(nasid); 375 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard_type);
376 if (rc) {
377 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
378 rc);
379 return 0;
380 }
375 381
376 switch (ioboard_type) { 382 switch (ioboard_type) {
377 case L1_BRICKTYPE_SA: 383 case L1_BRICKTYPE_SA:
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 98f716bd92f0..ab1211ef0176 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -74,6 +74,22 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
74 return (int)ret_stuff.v0; 74 return (int)ret_stuff.v0;
75} 75}
76 76
77u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
78{
79 s64 rc;
80 u16 ioboard;
81 nasid_t nasid = NASID_GET(SN_PCIBUS_BUSSOFT(pci_bus)->bs_base);
82
83 rc = ia64_sn_sysctl_ioboard_get(nasid, &ioboard);
84 if (rc) {
85 printk(KERN_WARNING "ia64_sn_sysctl_ioboard_get failed: %ld\n",
86 rc);
87 return 0;
88 }
89
90 return ioboard;
91}
92
77/* 93/*
78 * PCI Bridge Error interrupt handler. Gets invoked whenever a PCI 94 * PCI Bridge Error interrupt handler. Gets invoked whenever a PCI
79 * bridge sends an error interrupt. 95 * bridge sends an error interrupt.
@@ -255,3 +271,4 @@ pcibr_init_provider(void)
255 271
256EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable); 272EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
257EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable); 273EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);
274EXPORT_SYMBOL_GPL(sn_ioboard_to_pci_bus);