diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-06 20:24:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-06 20:24:58 -0500 |
commit | 0670afdf0e69e5e73c8358da9c39bf3a8807b03e (patch) | |
tree | 671e6030b1ad9c38513c1cba9a9116f9dee8d41a /arch/ia64/kernel | |
parent | dda2ac15d23b38e4335e858848aa8c9a6710304f (diff) | |
parent | 51099005ab8e09d68a13fea8d55bc739c1040ca6 (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: (27 commits)
[IA64] swiotlb abstraction (e.g. for Xen)
[IA64] swiotlb cleanup
[IA64] make swiotlb use bus_to_virt/virt_to_bus
[IA64] swiotlb bug fixes
[IA64] Hook up getcpu system call for IA64
[IA64] clean up sparsemem memory_present call
[IA64] show_mem() for IA64 sparsemem NUMA
[IA64] missing exports hwsw_sync_...
[IA64] virt_to_page() can be called with NULL arg
[IA64] alignment bug in ldscript
[IA64] register memory ranges in a consistent manner
[IA64] Enable SWIOTLB only when needed
[IA64-SGI] Check for TIO errors on shub2 Altix
[IA64] remove bogus prototype ia64_esi_init()
[IA64] Clear IRQ affinity when unregistered
[IA64] fix ACPI Kconfig issues
[IA64] Fix NULL-pointer dereference in ia64_machine_kexec()
[IA64] find thread for user rbs address
[IA64] use snprintf() on features field of /proc/cpuinfo
[IA64] enable singlestep on system call
...
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/crash.c | 16 | ||||
-rw-r--r-- | arch/ia64/kernel/crash_dump.c | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/efi.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/iosapic.c | 5 | ||||
-rw-r--r-- | arch/ia64/kernel/machine_kexec.c | 15 | ||||
-rw-r--r-- | arch/ia64/kernel/process.c | 16 | ||||
-rw-r--r-- | arch/ia64/kernel/ptrace.c | 14 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 31 | ||||
-rw-r--r-- | arch/ia64/kernel/vmlinux.lds.S | 1 |
10 files changed, 63 insertions, 42 deletions
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index bc2f64d72244..9d92097ce96d 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c | |||
@@ -79,6 +79,7 @@ crash_save_this_cpu() | |||
79 | final_note(buf); | 79 | final_note(buf); |
80 | } | 80 | } |
81 | 81 | ||
82 | #ifdef CONFIG_SMP | ||
82 | static int | 83 | static int |
83 | kdump_wait_cpu_freeze(void) | 84 | kdump_wait_cpu_freeze(void) |
84 | { | 85 | { |
@@ -91,6 +92,7 @@ kdump_wait_cpu_freeze(void) | |||
91 | } | 92 | } |
92 | return 1; | 93 | return 1; |
93 | } | 94 | } |
95 | #endif | ||
94 | 96 | ||
95 | void | 97 | void |
96 | machine_crash_shutdown(struct pt_regs *pt) | 98 | machine_crash_shutdown(struct pt_regs *pt) |
@@ -116,6 +118,11 @@ machine_crash_shutdown(struct pt_regs *pt) | |||
116 | static void | 118 | static void |
117 | machine_kdump_on_init(void) | 119 | machine_kdump_on_init(void) |
118 | { | 120 | { |
121 | if (!ia64_kimage) { | ||
122 | printk(KERN_NOTICE "machine_kdump_on_init(): " | ||
123 | "kdump not configured\n"); | ||
124 | return; | ||
125 | } | ||
119 | local_irq_disable(); | 126 | local_irq_disable(); |
120 | kexec_disable_iosapic(); | 127 | kexec_disable_iosapic(); |
121 | machine_kexec(ia64_kimage); | 128 | machine_kexec(ia64_kimage); |
@@ -132,11 +139,12 @@ kdump_cpu_freeze(struct unw_frame_info *info, void *arg) | |||
132 | atomic_inc(&kdump_cpu_freezed); | 139 | atomic_inc(&kdump_cpu_freezed); |
133 | kdump_status[cpuid] = 1; | 140 | kdump_status[cpuid] = 1; |
134 | mb(); | 141 | mb(); |
135 | if (cpuid == 0) { | 142 | #ifdef CONFIG_HOTPLUG_CPU |
136 | for (;;) | 143 | if (cpuid != 0) |
137 | cpu_relax(); | ||
138 | } else | ||
139 | ia64_jump_to_sal(&sal_boot_rendez_state[cpuid]); | 144 | ia64_jump_to_sal(&sal_boot_rendez_state[cpuid]); |
145 | #endif | ||
146 | for (;;) | ||
147 | cpu_relax(); | ||
140 | } | 148 | } |
141 | 149 | ||
142 | static int | 150 | static int |
diff --git a/arch/ia64/kernel/crash_dump.c b/arch/ia64/kernel/crash_dump.c index 83b8c91c1408..da60e90eeeb1 100644 --- a/arch/ia64/kernel/crash_dump.c +++ b/arch/ia64/kernel/crash_dump.c | |||
@@ -9,7 +9,8 @@ | |||
9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | 11 | ||
12 | #include <linux/uaccess.h> | 12 | #include <asm/page.h> |
13 | #include <asm/uaccess.h> | ||
13 | 14 | ||
14 | /** | 15 | /** |
15 | * copy_oldmem_page - copy one page from "oldmem" | 16 | * copy_oldmem_page - copy one page from "oldmem" |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 0b25a7d4e1e4..6c03928544c2 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -380,7 +380,7 @@ efi_get_pal_addr (void) | |||
380 | #endif | 380 | #endif |
381 | return __va(md->phys_addr); | 381 | return __va(md->phys_addr); |
382 | } | 382 | } |
383 | printk(KERN_WARNING "%s: no PAL-code memory-descriptor found", | 383 | printk(KERN_WARNING "%s: no PAL-code memory-descriptor found\n", |
384 | __FUNCTION__); | 384 | __FUNCTION__); |
385 | return NULL; | 385 | return NULL; |
386 | } | 386 | } |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 15234ed3a341..e7873eeae448 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1610,5 +1610,7 @@ sys_call_table: | |||
1610 | data8 sys_sync_file_range // 1300 | 1610 | data8 sys_sync_file_range // 1300 |
1611 | data8 sys_tee | 1611 | data8 sys_tee |
1612 | data8 sys_vmsplice | 1612 | data8 sys_vmsplice |
1613 | data8 sys_ni_syscall // reserved for move_pages | ||
1614 | data8 sys_getcpu | ||
1613 | 1615 | ||
1614 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1616 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 0fc5fb7865cf..d6aab40c6416 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
@@ -925,6 +925,11 @@ iosapic_unregister_intr (unsigned int gsi) | |||
925 | /* Clear the interrupt controller descriptor */ | 925 | /* Clear the interrupt controller descriptor */ |
926 | idesc->chip = &no_irq_type; | 926 | idesc->chip = &no_irq_type; |
927 | 927 | ||
928 | #ifdef CONFIG_SMP | ||
929 | /* Clear affinity */ | ||
930 | cpus_setall(idesc->affinity); | ||
931 | #endif | ||
932 | |||
928 | /* Clear the interrupt information */ | 933 | /* Clear the interrupt information */ |
929 | memset(&iosapic_intr_info[vector], 0, | 934 | memset(&iosapic_intr_info[vector], 0, |
930 | sizeof(struct iosapic_intr_info)); | 935 | sizeof(struct iosapic_intr_info)); |
diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c index e2ccc9f660c5..4f0f3b8c1ee2 100644 --- a/arch/ia64/kernel/machine_kexec.c +++ b/arch/ia64/kernel/machine_kexec.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/kexec.h> | 14 | #include <linux/kexec.h> |
15 | #include <linux/cpu.h> | 15 | #include <linux/cpu.h> |
16 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
17 | #include <linux/efi.h> | ||
17 | #include <asm/mmu_context.h> | 18 | #include <asm/mmu_context.h> |
18 | #include <asm/setup.h> | 19 | #include <asm/setup.h> |
19 | #include <asm/delay.h> | 20 | #include <asm/delay.h> |
@@ -68,22 +69,10 @@ void machine_kexec_cleanup(struct kimage *image) | |||
68 | { | 69 | { |
69 | } | 70 | } |
70 | 71 | ||
71 | void machine_shutdown(void) | ||
72 | { | ||
73 | int cpu; | ||
74 | |||
75 | for_each_online_cpu(cpu) { | ||
76 | if (cpu != smp_processor_id()) | ||
77 | cpu_down(cpu); | ||
78 | } | ||
79 | kexec_disable_iosapic(); | ||
80 | } | ||
81 | |||
82 | /* | 72 | /* |
83 | * Do not allocate memory (or fail in any way) in machine_kexec(). | 73 | * Do not allocate memory (or fail in any way) in machine_kexec(). |
84 | * We are past the point of no return, committed to rebooting now. | 74 | * We are past the point of no return, committed to rebooting now. |
85 | */ | 75 | */ |
86 | extern void *efi_get_pal_addr(void); | ||
87 | static void ia64_machine_kexec(struct unw_frame_info *info, void *arg) | 76 | static void ia64_machine_kexec(struct unw_frame_info *info, void *arg) |
88 | { | 77 | { |
89 | struct kimage *image = arg; | 78 | struct kimage *image = arg; |
@@ -93,6 +82,7 @@ static void ia64_machine_kexec(struct unw_frame_info *info, void *arg) | |||
93 | unsigned long vector; | 82 | unsigned long vector; |
94 | int ii; | 83 | int ii; |
95 | 84 | ||
85 | BUG_ON(!image); | ||
96 | if (image->type == KEXEC_TYPE_CRASH) { | 86 | if (image->type == KEXEC_TYPE_CRASH) { |
97 | crash_save_this_cpu(); | 87 | crash_save_this_cpu(); |
98 | current->thread.ksp = (__u64)info->sw - 16; | 88 | current->thread.ksp = (__u64)info->sw - 16; |
@@ -131,6 +121,7 @@ static void ia64_machine_kexec(struct unw_frame_info *info, void *arg) | |||
131 | 121 | ||
132 | void machine_kexec(struct kimage *image) | 122 | void machine_kexec(struct kimage *image) |
133 | { | 123 | { |
124 | BUG_ON(!image); | ||
134 | unw_init_running(ia64_machine_kexec, image); | 125 | unw_init_running(ia64_machine_kexec, image); |
135 | for(;;); | 126 | for(;;); |
136 | } | 127 | } |
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 17685abaf496..ae96d4176995 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/ia32.h> | 34 | #include <asm/ia32.h> |
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
36 | #include <asm/kdebug.h> | 36 | #include <asm/kdebug.h> |
37 | #include <asm/kexec.h> | ||
37 | #include <asm/pgalloc.h> | 38 | #include <asm/pgalloc.h> |
38 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
39 | #include <asm/sal.h> | 40 | #include <asm/sal.h> |
@@ -803,6 +804,21 @@ cpu_halt (void) | |||
803 | ia64_pal_halt(min_power_state); | 804 | ia64_pal_halt(min_power_state); |
804 | } | 805 | } |
805 | 806 | ||
807 | void machine_shutdown(void) | ||
808 | { | ||
809 | #ifdef CONFIG_HOTPLUG_CPU | ||
810 | int cpu; | ||
811 | |||
812 | for_each_online_cpu(cpu) { | ||
813 | if (cpu != smp_processor_id()) | ||
814 | cpu_down(cpu); | ||
815 | } | ||
816 | #endif | ||
817 | #ifdef CONFIG_KEXEC | ||
818 | kexec_disable_iosapic(); | ||
819 | #endif | ||
820 | } | ||
821 | |||
806 | void | 822 | void |
807 | machine_restart (char *restart_cmd) | 823 | machine_restart (char *restart_cmd) |
808 | { | 824 | { |
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index aa705e46b974..3f8918782e0c 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c | |||
@@ -607,7 +607,7 @@ find_thread_for_addr (struct task_struct *child, unsigned long addr) | |||
607 | */ | 607 | */ |
608 | list_for_each_safe(this, next, ¤t->children) { | 608 | list_for_each_safe(this, next, ¤t->children) { |
609 | p = list_entry(this, struct task_struct, sibling); | 609 | p = list_entry(this, struct task_struct, sibling); |
610 | if (p->mm != mm) | 610 | if (p->tgid != child->tgid) |
611 | continue; | 611 | continue; |
612 | if (thread_matches(p, addr)) { | 612 | if (thread_matches(p, addr)) { |
613 | child = p; | 613 | child = p; |
@@ -1405,6 +1405,7 @@ ptrace_disable (struct task_struct *child) | |||
1405 | struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child)); | 1405 | struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child)); |
1406 | 1406 | ||
1407 | /* make sure the single step/taken-branch trap bits are not set: */ | 1407 | /* make sure the single step/taken-branch trap bits are not set: */ |
1408 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
1408 | child_psr->ss = 0; | 1409 | child_psr->ss = 0; |
1409 | child_psr->tb = 0; | 1410 | child_psr->tb = 0; |
1410 | } | 1411 | } |
@@ -1525,6 +1526,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) | |||
1525 | * Make sure the single step/taken-branch trap bits | 1526 | * Make sure the single step/taken-branch trap bits |
1526 | * are not set: | 1527 | * are not set: |
1527 | */ | 1528 | */ |
1529 | clear_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
1528 | ia64_psr(pt)->ss = 0; | 1530 | ia64_psr(pt)->ss = 0; |
1529 | ia64_psr(pt)->tb = 0; | 1531 | ia64_psr(pt)->tb = 0; |
1530 | 1532 | ||
@@ -1556,6 +1558,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) | |||
1556 | goto out_tsk; | 1558 | goto out_tsk; |
1557 | 1559 | ||
1558 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 1560 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
1561 | set_tsk_thread_flag(child, TIF_SINGLESTEP); | ||
1559 | if (request == PTRACE_SINGLESTEP) { | 1562 | if (request == PTRACE_SINGLESTEP) { |
1560 | ia64_psr(pt)->ss = 1; | 1563 | ia64_psr(pt)->ss = 1; |
1561 | } else { | 1564 | } else { |
@@ -1595,13 +1598,9 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) | |||
1595 | } | 1598 | } |
1596 | 1599 | ||
1597 | 1600 | ||
1598 | void | 1601 | static void |
1599 | syscall_trace (void) | 1602 | syscall_trace (void) |
1600 | { | 1603 | { |
1601 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | ||
1602 | return; | ||
1603 | if (!(current->ptrace & PT_PTRACED)) | ||
1604 | return; | ||
1605 | /* | 1604 | /* |
1606 | * The 0x80 provides a way for the tracing parent to | 1605 | * The 0x80 provides a way for the tracing parent to |
1607 | * distinguish between a syscall stop and SIGTRAP delivery. | 1606 | * distinguish between a syscall stop and SIGTRAP delivery. |
@@ -1664,7 +1663,8 @@ syscall_trace_leave (long arg0, long arg1, long arg2, long arg3, | |||
1664 | audit_syscall_exit(success, result); | 1663 | audit_syscall_exit(success, result); |
1665 | } | 1664 | } |
1666 | 1665 | ||
1667 | if (test_thread_flag(TIF_SYSCALL_TRACE) | 1666 | if ((test_thread_flag(TIF_SYSCALL_TRACE) |
1667 | || test_thread_flag(TIF_SINGLESTEP)) | ||
1668 | && (current->ptrace & PT_PTRACED)) | 1668 | && (current->ptrace & PT_PTRACED)) |
1669 | syscall_trace(); | 1669 | syscall_trace(); |
1670 | } | 1670 | } |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index ad567b8d432e..83c2629e1c4c 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -569,34 +569,31 @@ show_cpuinfo (struct seq_file *m, void *v) | |||
569 | { 1UL << 1, "spontaneous deferral"}, | 569 | { 1UL << 1, "spontaneous deferral"}, |
570 | { 1UL << 2, "16-byte atomic ops" } | 570 | { 1UL << 2, "16-byte atomic ops" } |
571 | }; | 571 | }; |
572 | char features[128], *cp, sep; | 572 | char features[128], *cp, *sep; |
573 | struct cpuinfo_ia64 *c = v; | 573 | struct cpuinfo_ia64 *c = v; |
574 | unsigned long mask; | 574 | unsigned long mask; |
575 | unsigned long proc_freq; | 575 | unsigned long proc_freq; |
576 | int i; | 576 | int i, size; |
577 | 577 | ||
578 | mask = c->features; | 578 | mask = c->features; |
579 | 579 | ||
580 | /* build the feature string: */ | 580 | /* build the feature string: */ |
581 | memcpy(features, " standard", 10); | 581 | memcpy(features, "standard", 9); |
582 | cp = features; | 582 | cp = features; |
583 | sep = 0; | 583 | size = sizeof(features); |
584 | for (i = 0; i < (int) ARRAY_SIZE(feature_bits); ++i) { | 584 | sep = ""; |
585 | for (i = 0; i < ARRAY_SIZE(feature_bits) && size > 1; ++i) { | ||
585 | if (mask & feature_bits[i].mask) { | 586 | if (mask & feature_bits[i].mask) { |
586 | if (sep) | 587 | cp += snprintf(cp, size, "%s%s", sep, |
587 | *cp++ = sep; | 588 | feature_bits[i].feature_name), |
588 | sep = ','; | 589 | sep = ", "; |
589 | *cp++ = ' '; | ||
590 | strcpy(cp, feature_bits[i].feature_name); | ||
591 | cp += strlen(feature_bits[i].feature_name); | ||
592 | mask &= ~feature_bits[i].mask; | 590 | mask &= ~feature_bits[i].mask; |
591 | size = sizeof(features) - (cp - features); | ||
593 | } | 592 | } |
594 | } | 593 | } |
595 | if (mask) { | 594 | if (mask && size > 1) { |
596 | /* print unknown features as a hex value: */ | 595 | /* print unknown features as a hex value */ |
597 | if (sep) | 596 | snprintf(cp, size, "%s0x%lx", sep, mask); |
598 | *cp++ = sep; | ||
599 | sprintf(cp, " 0x%lx", mask); | ||
600 | } | 597 | } |
601 | 598 | ||
602 | proc_freq = cpufreq_quick_get(cpunum); | 599 | proc_freq = cpufreq_quick_get(cpunum); |
@@ -612,7 +609,7 @@ show_cpuinfo (struct seq_file *m, void *v) | |||
612 | "model name : %s\n" | 609 | "model name : %s\n" |
613 | "revision : %u\n" | 610 | "revision : %u\n" |
614 | "archrev : %u\n" | 611 | "archrev : %u\n" |
615 | "features :%s\n" /* don't change this---it _is_ right! */ | 612 | "features : %s\n" |
616 | "cpu number : %lu\n" | 613 | "cpu number : %lu\n" |
617 | "cpu regs : %u\n" | 614 | "cpu regs : %u\n" |
618 | "cpu MHz : %lu.%06lu\n" | 615 | "cpu MHz : %lu.%06lu\n" |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index d6083a0936f4..8f3d0066f446 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -157,6 +157,7 @@ SECTIONS | |||
157 | } | 157 | } |
158 | #endif | 158 | #endif |
159 | 159 | ||
160 | . = ALIGN(8); | ||
160 | __con_initcall_start = .; | 161 | __con_initcall_start = .; |
161 | .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) | 162 | .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) |
162 | { *(.con_initcall.init) } | 163 | { *(.con_initcall.init) } |