diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-14 18:30:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-14 18:30:45 -0400 |
commit | d470c05bedc27dbd2df9d0bb6fd82336e4ff43db (patch) | |
tree | e0dd12e061f6b2648e1ddac84eeb7232490f01e2 /arch | |
parent | ee67e6cbe1121da1ae4eceb7b2bcb535c5cbf65e (diff) | |
parent | 457b646189e47f9d48588809da3e806ec363f219 (diff) |
Merge branch 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Fix a TRACE_IRQS_OFF typo.
sh: Optimize the setup_rt_frame() I-cache flush.
sh: Populate initial secondary CPU info from boot_cpu_data.
sh: Tidy up SMP cpuinfo.
sh: Use boot_cpu_data for FPU tests in sigcontext paths.
sh: ftrace: Fix up syscall tracepoint support.
sh: force dcache flush if dcache_dirty bit set.
sh: update die() output.
Diffstat (limited to 'arch')
-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/setup.c | 2 | ||||
-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 | 7 | ||||
-rw-r--r-- | arch/sh/mm/cache.c | 2 |
7 files changed, 41 insertions, 20 deletions
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/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/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 e0b5e4b5accd..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> |
@@ -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 | ||
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index 35c37b7f717a..5e1091be9dc4 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
@@ -128,7 +128,7 @@ void __update_cache(struct vm_area_struct *vma, | |||
128 | return; | 128 | return; |
129 | 129 | ||
130 | page = pfn_to_page(pfn); | 130 | page = pfn_to_page(pfn); |
131 | if (pfn_valid(pfn) && page_mapping(page)) { | 131 | if (pfn_valid(pfn)) { |
132 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | 132 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); |
133 | if (dirty) { | 133 | if (dirty) { |
134 | unsigned long addr = (unsigned long)page_address(page); | 134 | unsigned long addr = (unsigned long)page_address(page); |