diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-06 10:46:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-06 10:46:18 -0500 |
commit | 330f28f691e9b349e34adcaf82b273cf061bb491 (patch) | |
tree | fca3bfe41eff25ef19f576cef1979c68f6521af5 /arch/sh/kernel | |
parent | fe3e78e073d25308756f38019956061153267769 (diff) | |
parent | 6fc786d5034ed7ce2d43c459211137de6d99dd28 (diff) |
Merge branch 'for-2.6.32' into for-2.6.33
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/entry.S | 2 | ||||
-rw-r--r-- | arch/sh/kernel/dwarf.c | 22 | ||||
-rw-r--r-- | arch/sh/kernel/entry-common.S | 2 | ||||
-rw-r--r-- | arch/sh/kernel/ftrace.c | 37 | ||||
-rw-r--r-- | arch/sh/kernel/io_generic.c | 3 | ||||
-rw-r--r-- | arch/sh/kernel/irq.c | 3 | ||||
-rw-r--r-- | arch/sh/kernel/machvec.c | 3 | ||||
-rw-r--r-- | arch/sh/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/sh_ksyms_32.c | 15 | ||||
-rw-r--r-- | arch/sh/kernel/signal_32.c | 9 | ||||
-rw-r--r-- | arch/sh/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/traps_32.c | 11 |
12 files changed, 87 insertions, 24 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index 0151933e5253..bb407ef0b91e 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -152,8 +152,6 @@ call_do_page_fault: | |||
152 | mov.l 1f, r0 | 152 | mov.l 1f, r0 |
153 | mov.l @r0, r6 | 153 | mov.l @r0, r6 |
154 | 154 | ||
155 | sti | ||
156 | |||
157 | mov.l 3f, r0 | 155 | mov.l 3f, r0 |
158 | mov.l 4f, r1 | 156 | mov.l 4f, r1 |
159 | mov r15, r4 | 157 | mov r15, r4 |
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index 03b3616c80a5..2d07084e4882 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | #include <linux/mempool.h> | 21 | #include <linux/mempool.h> |
22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
23 | #include <linux/ftrace.h> | ||
23 | #include <asm/dwarf.h> | 24 | #include <asm/dwarf.h> |
24 | #include <asm/unwinder.h> | 25 | #include <asm/unwinder.h> |
25 | #include <asm/sections.h> | 26 | #include <asm/sections.h> |
@@ -557,6 +558,27 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc, | |||
557 | if (!pc && !prev) | 558 | if (!pc && !prev) |
558 | pc = (unsigned long)current_text_addr(); | 559 | pc = (unsigned long)current_text_addr(); |
559 | 560 | ||
561 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
562 | /* | ||
563 | * If our stack has been patched by the function graph tracer | ||
564 | * then we might see the address of return_to_handler() where we | ||
565 | * expected to find the real return address. | ||
566 | */ | ||
567 | if (pc == (unsigned long)&return_to_handler) { | ||
568 | int index = current->curr_ret_stack; | ||
569 | |||
570 | /* | ||
571 | * We currently have no way of tracking how many | ||
572 | * return_to_handler()'s we've seen. If there is more | ||
573 | * than one patched return address on our stack, | ||
574 | * complain loudly. | ||
575 | */ | ||
576 | WARN_ON(index > 0); | ||
577 | |||
578 | pc = current->ret_stack[index].ret; | ||
579 | } | ||
580 | #endif | ||
581 | |||
560 | frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC); | 582 | frame = mempool_alloc(dwarf_frame_pool, GFP_ATOMIC); |
561 | if (!frame) { | 583 | if (!frame) { |
562 | printk(KERN_ERR "Unable to allocate a dwarf frame\n"); | 584 | printk(KERN_ERR "Unable to allocate a dwarf frame\n"); |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 68d9223b145e..3eb84931d2aa 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -121,7 +121,7 @@ noresched: | |||
121 | ENTRY(resume_userspace) | 121 | ENTRY(resume_userspace) |
122 | ! r8: current_thread_info | 122 | ! r8: current_thread_info |
123 | cli | 123 | cli |
124 | TRACE_IRQS_OfF | 124 | TRACE_IRQS_OFF |
125 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags | 125 | mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags |
126 | tst #(_TIF_WORK_MASK & 0xff), r0 | 126 | tst #(_TIF_WORK_MASK & 0xff), r0 |
127 | bt/s __restore_all | 127 | bt/s __restore_all |
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index a3dcc6d5d253..2c48e267256e 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c | |||
@@ -291,31 +291,48 @@ struct syscall_metadata *syscall_nr_to_meta(int nr) | |||
291 | return syscalls_metadata[nr]; | 291 | return syscalls_metadata[nr]; |
292 | } | 292 | } |
293 | 293 | ||
294 | void arch_init_ftrace_syscalls(void) | 294 | int syscall_name_to_nr(char *name) |
295 | { | ||
296 | int i; | ||
297 | |||
298 | if (!syscalls_metadata) | ||
299 | return -1; | ||
300 | for (i = 0; i < NR_syscalls; i++) | ||
301 | if (syscalls_metadata[i]) | ||
302 | if (!strcmp(syscalls_metadata[i]->name, name)) | ||
303 | return i; | ||
304 | return -1; | ||
305 | } | ||
306 | |||
307 | void set_syscall_enter_id(int num, int id) | ||
308 | { | ||
309 | syscalls_metadata[num]->enter_id = id; | ||
310 | } | ||
311 | |||
312 | void set_syscall_exit_id(int num, int id) | ||
313 | { | ||
314 | syscalls_metadata[num]->exit_id = id; | ||
315 | } | ||
316 | |||
317 | static int __init arch_init_ftrace_syscalls(void) | ||
295 | { | 318 | { |
296 | int i; | 319 | int i; |
297 | struct syscall_metadata *meta; | 320 | struct syscall_metadata *meta; |
298 | unsigned long **psys_syscall_table = &sys_call_table; | 321 | unsigned long **psys_syscall_table = &sys_call_table; |
299 | static atomic_t refs; | ||
300 | |||
301 | if (atomic_inc_return(&refs) != 1) | ||
302 | goto end; | ||
303 | 322 | ||
304 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * | 323 | syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * |
305 | FTRACE_SYSCALL_MAX, GFP_KERNEL); | 324 | FTRACE_SYSCALL_MAX, GFP_KERNEL); |
306 | if (!syscalls_metadata) { | 325 | if (!syscalls_metadata) { |
307 | WARN_ON(1); | 326 | WARN_ON(1); |
308 | return; | 327 | return -ENOMEM; |
309 | } | 328 | } |
310 | 329 | ||
311 | for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { | 330 | for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { |
312 | meta = find_syscall_meta(psys_syscall_table[i]); | 331 | meta = find_syscall_meta(psys_syscall_table[i]); |
313 | syscalls_metadata[i] = meta; | 332 | syscalls_metadata[i] = meta; |
314 | } | 333 | } |
315 | return; | ||
316 | 334 | ||
317 | /* Paranoid: avoid overflow */ | 335 | return 0; |
318 | end: | ||
319 | atomic_dec(&refs); | ||
320 | } | 336 | } |
337 | arch_initcall(arch_init_ftrace_syscalls); | ||
321 | #endif /* CONFIG_FTRACE_SYSCALLS */ | 338 | #endif /* CONFIG_FTRACE_SYSCALLS */ |
diff --git a/arch/sh/kernel/io_generic.c b/arch/sh/kernel/io_generic.c index 4ff507239286..b8fa6524760a 100644 --- a/arch/sh/kernel/io_generic.c +++ b/arch/sh/kernel/io_generic.c | |||
@@ -147,6 +147,9 @@ void generic_outsl(unsigned long port, const void *src, unsigned long count) | |||
147 | 147 | ||
148 | void __iomem *generic_ioport_map(unsigned long addr, unsigned int size) | 148 | void __iomem *generic_ioport_map(unsigned long addr, unsigned int size) |
149 | { | 149 | { |
150 | if (PXSEG(addr) >= P1SEG) | ||
151 | return (void __iomem *)addr; | ||
152 | |||
150 | return (void __iomem *)(addr + generic_io_base); | 153 | return (void __iomem *)(addr + generic_io_base); |
151 | } | 154 | } |
152 | 155 | ||
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 7cb933ba4957..eac7da772fc2 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/kernel_stat.h> | 12 | #include <linux/kernel_stat.h> |
13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
14 | #include <linux/ftrace.h> | ||
14 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
15 | #include <asm/machvec.h> | 16 | #include <asm/machvec.h> |
16 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
@@ -106,7 +107,7 @@ static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly; | |||
106 | static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; | 107 | static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; |
107 | #endif | 108 | #endif |
108 | 109 | ||
109 | asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs) | 110 | asmlinkage __irq_entry int do_IRQ(unsigned int irq, struct pt_regs *regs) |
110 | { | 111 | { |
111 | struct pt_regs *old_regs = set_irq_regs(regs); | 112 | struct pt_regs *old_regs = set_irq_regs(regs); |
112 | #ifdef CONFIG_IRQSTACKS | 113 | #ifdef CONFIG_IRQSTACKS |
diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c index 548f6607fd0f..cbce639b108a 100644 --- a/arch/sh/kernel/machvec.c +++ b/arch/sh/kernel/machvec.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <asm/machvec.h> | 15 | #include <asm/machvec.h> |
16 | #include <asm/sections.h> | 16 | #include <asm/sections.h> |
17 | #include <asm/addrspace.h> | ||
17 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
19 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
@@ -133,4 +134,6 @@ void __init sh_mv_setup(void) | |||
133 | 134 | ||
134 | if (!sh_mv.mv_nr_irqs) | 135 | if (!sh_mv.mv_nr_irqs) |
135 | sh_mv.mv_nr_irqs = NR_IRQS; | 136 | sh_mv.mv_nr_irqs = NR_IRQS; |
137 | |||
138 | __set_io_port_base(P2SEG); | ||
136 | } | 139 | } |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index f9d44f8e0df6..99b4fb553bf1 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -549,6 +549,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
549 | 549 | ||
550 | if (cpu == 0) | 550 | if (cpu == 0) |
551 | seq_printf(m, "machine\t\t: %s\n", get_system_type()); | 551 | seq_printf(m, "machine\t\t: %s\n", get_system_type()); |
552 | else | ||
553 | seq_printf(m, "\n"); | ||
552 | 554 | ||
553 | seq_printf(m, "processor\t: %d\n", cpu); | 555 | seq_printf(m, "processor\t: %d\n", cpu); |
554 | seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine); | 556 | seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine); |
diff --git a/arch/sh/kernel/sh_ksyms_32.c b/arch/sh/kernel/sh_ksyms_32.c index 8dbe26b17c44..444cce3ae921 100644 --- a/arch/sh/kernel/sh_ksyms_32.c +++ b/arch/sh/kernel/sh_ksyms_32.c | |||
@@ -84,6 +84,21 @@ DECLARE_EXPORT(__movstrSI60); | |||
84 | DECLARE_EXPORT(__movstr_i4_even); | 84 | DECLARE_EXPORT(__movstr_i4_even); |
85 | DECLARE_EXPORT(__movstr_i4_odd); | 85 | DECLARE_EXPORT(__movstr_i4_odd); |
86 | DECLARE_EXPORT(__movstrSI12_i4); | 86 | DECLARE_EXPORT(__movstrSI12_i4); |
87 | DECLARE_EXPORT(__movmem); | ||
88 | DECLARE_EXPORT(__movmemSI8); | ||
89 | DECLARE_EXPORT(__movmemSI12); | ||
90 | DECLARE_EXPORT(__movmemSI16); | ||
91 | DECLARE_EXPORT(__movmemSI20); | ||
92 | DECLARE_EXPORT(__movmemSI24); | ||
93 | DECLARE_EXPORT(__movmemSI28); | ||
94 | DECLARE_EXPORT(__movmemSI32); | ||
95 | DECLARE_EXPORT(__movmemSI36); | ||
96 | DECLARE_EXPORT(__movmemSI40); | ||
97 | DECLARE_EXPORT(__movmemSI44); | ||
98 | DECLARE_EXPORT(__movmemSI48); | ||
99 | DECLARE_EXPORT(__movmemSI52); | ||
100 | DECLARE_EXPORT(__movmemSI56); | ||
101 | DECLARE_EXPORT(__movmemSI60); | ||
87 | DECLARE_EXPORT(__movmem_i4_even); | 102 | DECLARE_EXPORT(__movmem_i4_even); |
88 | DECLARE_EXPORT(__movmem_i4_odd); | 103 | DECLARE_EXPORT(__movmem_i4_odd); |
89 | DECLARE_EXPORT(__movmemSI12_i4); | 104 | DECLARE_EXPORT(__movmemSI12_i4); |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 6729703547a1..3db37425210d 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -145,7 +145,7 @@ static inline int restore_sigcontext_fpu(struct sigcontext __user *sc) | |||
145 | { | 145 | { |
146 | struct task_struct *tsk = current; | 146 | struct task_struct *tsk = current; |
147 | 147 | ||
148 | if (!(current_cpu_data.flags & CPU_HAS_FPU)) | 148 | if (!(boot_cpu_data.flags & CPU_HAS_FPU)) |
149 | return 0; | 149 | return 0; |
150 | 150 | ||
151 | set_used_math(); | 151 | set_used_math(); |
@@ -158,7 +158,7 @@ static inline int save_sigcontext_fpu(struct sigcontext __user *sc, | |||
158 | { | 158 | { |
159 | struct task_struct *tsk = current; | 159 | struct task_struct *tsk = current; |
160 | 160 | ||
161 | if (!(current_cpu_data.flags & CPU_HAS_FPU)) | 161 | if (!(boot_cpu_data.flags & CPU_HAS_FPU)) |
162 | return 0; | 162 | return 0; |
163 | 163 | ||
164 | if (!used_math()) { | 164 | if (!used_math()) { |
@@ -199,7 +199,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p | |||
199 | #undef COPY | 199 | #undef COPY |
200 | 200 | ||
201 | #ifdef CONFIG_SH_FPU | 201 | #ifdef CONFIG_SH_FPU |
202 | if (current_cpu_data.flags & CPU_HAS_FPU) { | 202 | if (boot_cpu_data.flags & CPU_HAS_FPU) { |
203 | int owned_fp; | 203 | int owned_fp; |
204 | struct task_struct *tsk = current; | 204 | struct task_struct *tsk = current; |
205 | 205 | ||
@@ -472,6 +472,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
472 | err |= __put_user(OR_R0_R0, &frame->retcode[6]); | 472 | err |= __put_user(OR_R0_R0, &frame->retcode[6]); |
473 | err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]); | 473 | err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]); |
474 | regs->pr = (unsigned long) frame->retcode; | 474 | regs->pr = (unsigned long) frame->retcode; |
475 | flush_icache_range(regs->pr, regs->pr + sizeof(frame->retcode)); | ||
475 | } | 476 | } |
476 | 477 | ||
477 | if (err) | 478 | if (err) |
@@ -497,8 +498,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
497 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", | 498 | pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", |
498 | current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); | 499 | current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); |
499 | 500 | ||
500 | flush_icache_range(regs->pr, regs->pr + sizeof(frame->retcode)); | ||
501 | |||
502 | return 0; | 501 | return 0; |
503 | 502 | ||
504 | give_sigsegv: | 503 | give_sigsegv: |
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 442d8d47a41e..160db1003cfb 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -35,6 +35,8 @@ static inline void __init smp_store_cpu_info(unsigned int cpu) | |||
35 | { | 35 | { |
36 | struct sh_cpuinfo *c = cpu_data + cpu; | 36 | struct sh_cpuinfo *c = cpu_data + cpu; |
37 | 37 | ||
38 | memcpy(c, &boot_cpu_data, sizeof(struct sh_cpuinfo)); | ||
39 | |||
38 | c->loops_per_jiffy = loops_per_jiffy; | 40 | c->loops_per_jiffy = loops_per_jiffy; |
39 | } | 41 | } |
40 | 42 | ||
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index 69bb1652eccd..7a2ee3a6b8e7 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/kexec.h> | 25 | #include <linux/kexec.h> |
26 | #include <linux/limits.h> | 26 | #include <linux/limits.h> |
27 | #include <linux/proc_fs.h> | 27 | #include <linux/proc_fs.h> |
28 | #include <linux/sysfs.h> | ||
28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
30 | #include <asm/fpu.h> | 31 | #include <asm/fpu.h> |
@@ -54,8 +55,8 @@ static unsigned long se_multi; | |||
54 | /* bitfield: 1: warn 2: fixup 4: signal -> combinations 2|4 && 1|2|4 are not | 55 | /* bitfield: 1: warn 2: fixup 4: signal -> combinations 2|4 && 1|2|4 are not |
55 | valid! */ | 56 | valid! */ |
56 | static int se_usermode = 3; | 57 | static int se_usermode = 3; |
57 | /* 0: no warning 1: print a warning message */ | 58 | /* 0: no warning 1: print a warning message, disabled by default */ |
58 | static int se_kernmode_warn = 1; | 59 | static int se_kernmode_warn; |
59 | 60 | ||
60 | #ifdef CONFIG_PROC_FS | 61 | #ifdef CONFIG_PROC_FS |
61 | static const char *se_usermode_action[] = { | 62 | static const char *se_usermode_action[] = { |
@@ -159,12 +160,12 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
159 | 160 | ||
160 | oops_enter(); | 161 | oops_enter(); |
161 | 162 | ||
162 | console_verbose(); | ||
163 | spin_lock_irq(&die_lock); | 163 | spin_lock_irq(&die_lock); |
164 | console_verbose(); | ||
164 | bust_spinlocks(1); | 165 | bust_spinlocks(1); |
165 | 166 | ||
166 | printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | 167 | printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); |
167 | 168 | sysfs_printk_last_file(); | |
168 | print_modules(); | 169 | print_modules(); |
169 | show_regs(regs); | 170 | show_regs(regs); |
170 | 171 | ||
@@ -180,6 +181,7 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
180 | bust_spinlocks(0); | 181 | bust_spinlocks(0); |
181 | add_taint(TAINT_DIE); | 182 | add_taint(TAINT_DIE); |
182 | spin_unlock_irq(&die_lock); | 183 | spin_unlock_irq(&die_lock); |
184 | oops_exit(); | ||
183 | 185 | ||
184 | if (kexec_should_crash(current)) | 186 | if (kexec_should_crash(current)) |
185 | crash_kexec(regs); | 187 | crash_kexec(regs); |
@@ -190,7 +192,6 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
190 | if (panic_on_oops) | 192 | if (panic_on_oops) |
191 | panic("Fatal exception"); | 193 | panic("Fatal exception"); |
192 | 194 | ||
193 | oops_exit(); | ||
194 | do_exit(SIGSEGV); | 195 | do_exit(SIGSEGV); |
195 | } | 196 | } |
196 | 197 | ||