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.

+41 -20
+1 -1
arch/sh/kernel/entry-common.S
··· 121 ENTRY(resume_userspace) 122 ! r8: current_thread_info 123 cli 124 - TRACE_IRQS_OfF 125 mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags 126 tst #(_TIF_WORK_MASK & 0xff), r0 127 bt/s __restore_all
··· 121 ENTRY(resume_userspace) 122 ! r8: current_thread_info 123 cli 124 + TRACE_IRQS_OFF 125 mov.l @(TI_FLAGS,r8), r0 ! current_thread_info->flags 126 tst #(_TIF_WORK_MASK & 0xff), r0 127 bt/s __restore_all
+27 -10
arch/sh/kernel/ftrace.c
··· 291 return syscalls_metadata[nr]; 292 } 293 294 - void arch_init_ftrace_syscalls(void) 295 { 296 int i; 297 struct syscall_metadata *meta; 298 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 304 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * 305 FTRACE_SYSCALL_MAX, GFP_KERNEL); 306 if (!syscalls_metadata) { 307 WARN_ON(1); 308 - return; 309 } 310 311 for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { 312 meta = find_syscall_meta(psys_syscall_table[i]); 313 syscalls_metadata[i] = meta; 314 } 315 - return; 316 317 - /* Paranoid: avoid overflow */ 318 - end: 319 - atomic_dec(&refs); 320 } 321 #endif /* CONFIG_FTRACE_SYSCALLS */
··· 291 return syscalls_metadata[nr]; 292 } 293 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) 318 { 319 int i; 320 struct syscall_metadata *meta; 321 unsigned long **psys_syscall_table = &sys_call_table; 322 323 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * 324 FTRACE_SYSCALL_MAX, GFP_KERNEL); 325 if (!syscalls_metadata) { 326 WARN_ON(1); 327 + return -ENOMEM; 328 } 329 330 for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { 331 meta = find_syscall_meta(psys_syscall_table[i]); 332 syscalls_metadata[i] = meta; 333 } 334 335 + return 0; 336 } 337 + arch_initcall(arch_init_ftrace_syscalls); 338 #endif /* CONFIG_FTRACE_SYSCALLS */
+2
arch/sh/kernel/setup.c
··· 549 550 if (cpu == 0) 551 seq_printf(m, "machine\t\t: %s\n", get_system_type()); 552 553 seq_printf(m, "processor\t: %d\n", cpu); 554 seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine);
··· 549 550 if (cpu == 0) 551 seq_printf(m, "machine\t\t: %s\n", get_system_type()); 552 + else 553 + seq_printf(m, "\n"); 554 555 seq_printf(m, "processor\t: %d\n", cpu); 556 seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine);
+4 -5
arch/sh/kernel/signal_32.c
··· 145 { 146 struct task_struct *tsk = current; 147 148 - if (!(current_cpu_data.flags & CPU_HAS_FPU)) 149 return 0; 150 151 set_used_math(); ··· 158 { 159 struct task_struct *tsk = current; 160 161 - if (!(current_cpu_data.flags & CPU_HAS_FPU)) 162 return 0; 163 164 if (!used_math()) { ··· 199 #undef COPY 200 201 #ifdef CONFIG_SH_FPU 202 - if (current_cpu_data.flags & CPU_HAS_FPU) { 203 int owned_fp; 204 struct task_struct *tsk = current; 205 ··· 472 err |= __put_user(OR_R0_R0, &frame->retcode[6]); 473 err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]); 474 regs->pr = (unsigned long) frame->retcode; 475 } 476 477 if (err) ··· 497 498 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n", 499 current->comm, task_pid_nr(current), frame, regs->pc, regs->pr); 500 - 501 - flush_icache_range(regs->pr, regs->pr + sizeof(frame->retcode)); 502 503 return 0; 504
··· 145 { 146 struct task_struct *tsk = current; 147 148 + if (!(boot_cpu_data.flags & CPU_HAS_FPU)) 149 return 0; 150 151 set_used_math(); ··· 158 { 159 struct task_struct *tsk = current; 160 161 + if (!(boot_cpu_data.flags & CPU_HAS_FPU)) 162 return 0; 163 164 if (!used_math()) { ··· 199 #undef COPY 200 201 #ifdef CONFIG_SH_FPU 202 + if (boot_cpu_data.flags & CPU_HAS_FPU) { 203 int owned_fp; 204 struct task_struct *tsk = current; 205 ··· 472 err |= __put_user(OR_R0_R0, &frame->retcode[6]); 473 err |= __put_user((__NR_rt_sigreturn), &frame->retcode[7]); 474 regs->pr = (unsigned long) frame->retcode; 475 + flush_icache_range(regs->pr, regs->pr + sizeof(frame->retcode)); 476 } 477 478 if (err) ··· 496 497 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 500 return 0; 501
+2
arch/sh/kernel/smp.c
··· 35 { 36 struct sh_cpuinfo *c = cpu_data + cpu; 37 38 c->loops_per_jiffy = loops_per_jiffy; 39 } 40
··· 35 { 36 struct sh_cpuinfo *c = cpu_data + cpu; 37 38 + memcpy(c, &boot_cpu_data, sizeof(struct sh_cpuinfo)); 39 + 40 c->loops_per_jiffy = loops_per_jiffy; 41 } 42
+4 -3
arch/sh/kernel/traps_32.c
··· 25 #include <linux/kexec.h> 26 #include <linux/limits.h> 27 #include <linux/proc_fs.h> 28 #include <asm/system.h> 29 #include <asm/uaccess.h> 30 #include <asm/fpu.h> ··· 160 161 oops_enter(); 162 163 - console_verbose(); 164 spin_lock_irq(&die_lock); 165 bust_spinlocks(1); 166 167 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 168 - 169 print_modules(); 170 show_regs(regs); 171 ··· 181 bust_spinlocks(0); 182 add_taint(TAINT_DIE); 183 spin_unlock_irq(&die_lock); 184 185 if (kexec_should_crash(current)) 186 crash_kexec(regs); ··· 192 if (panic_on_oops) 193 panic("Fatal exception"); 194 195 - oops_exit(); 196 do_exit(SIGSEGV); 197 } 198
··· 25 #include <linux/kexec.h> 26 #include <linux/limits.h> 27 #include <linux/proc_fs.h> 28 + #include <linux/sysfs.h> 29 #include <asm/system.h> 30 #include <asm/uaccess.h> 31 #include <asm/fpu.h> ··· 159 160 oops_enter(); 161 162 spin_lock_irq(&die_lock); 163 + console_verbose(); 164 bust_spinlocks(1); 165 166 printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 167 + sysfs_printk_last_file(); 168 print_modules(); 169 show_regs(regs); 170 ··· 180 bust_spinlocks(0); 181 add_taint(TAINT_DIE); 182 spin_unlock_irq(&die_lock); 183 + oops_exit(); 184 185 if (kexec_should_crash(current)) 186 crash_kexec(regs); ··· 190 if (panic_on_oops) 191 panic("Fatal exception"); 192 193 do_exit(SIGSEGV); 194 } 195
+1 -1
arch/sh/mm/cache.c
··· 128 return; 129 130 page = pfn_to_page(pfn); 131 - if (pfn_valid(pfn) && page_mapping(page)) { 132 int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); 133 if (dirty) { 134 unsigned long addr = (unsigned long)page_address(page);
··· 128 return; 129 130 page = pfn_to_page(pfn); 131 + if (pfn_valid(pfn)) { 132 int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); 133 if (dirty) { 134 unsigned long addr = (unsigned long)page_address(page);