From: Paul Mundt Date: Tue, 8 Dec 2009 06:47:12 +0000 (+0900) Subject: Merge branch 'master' into sh/hw-breakpoints X-Git-Tag: v2.6.34-rc1~285^2~136^3~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6424db52e24e8cdf89917fa3c10395116440160e;p=profile%2Fivi%2Fkernel-x86-ivi.git Merge branch 'master' into sh/hw-breakpoints Conflict between FPU thread flag migration and debug thread flag addition. Conflicts: arch/sh/include/asm/thread_info.h arch/sh/include/asm/ubc.h arch/sh/kernel/process_32.c --- 6424db52e24e8cdf89917fa3c10395116440160e diff --cc arch/sh/Kconfig index d563884,0031a69..185e9af --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@@ -37,9 -39,9 +39,10 @@@ config SUPERH3 select HAVE_FTRACE_MCOUNT_RECORD select HAVE_DYNAMIC_FTRACE select HAVE_FUNCTION_TRACE_MCOUNT_TEST + select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE select HAVE_FUNCTION_GRAPH_TRACER select HAVE_ARCH_KGDB + select HAVE_HW_BREAKPOINT if CPU_SH4A select ARCH_HIBERNATION_POSSIBLE if MMU config SUPERH64 diff --cc arch/sh/include/asm/thread_info.h index 8ab9145,1f3d927..e0856b2 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h @@@ -117,8 -118,6 +118,7 @@@ extern void free_thread_info(struct thr #define TIF_SECCOMP 6 /* secure computing */ #define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ #define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */ +#define TIF_DEBUG 9 /* uses UBC */ - #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_MEMDIE 18 #define TIF_FREEZE 19 /* Freezing for suspend */ @@@ -132,8 -130,6 +131,7 @@@ #define _TIF_SECCOMP (1 << TIF_SECCOMP) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) +#define _TIF_DEBUG (1 << TIF_DEBUG) - #define _TIF_USEDFPU (1 << TIF_USEDFPU) #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_FREEZE (1 << TIF_FREEZE) diff --cc arch/sh/include/asm/ubc.h index dd78781,9bf9616..e3c2968 --- a/arch/sh/include/asm/ubc.h +++ b/arch/sh/include/asm/ubc.h @@@ -60,22 -60,5 +60,11 @@@ #define BRCR_UBDE (1 << 0) #endif +/* + * All SH parts have 2 UBC channels. I defy any hardware designer to + * invalidate this assertion. + */ +#define NR_UBC_CHANNELS 2 + - #ifndef __ASSEMBLY__ - /* arch/sh/kernel/cpu/ubc.S */ - extern void ubc_sleep(void); - - #ifdef CONFIG_UBC_WAKEUP - extern void ubc_wakeup(void); - #else - #define ubc_wakeup() do { } while (0) - #endif - #endif - #endif /* __KERNEL__ */ #endif /* __ASM_SH_UBC_H */ diff --cc arch/sh/kernel/Makefile index 649daad,0471a3e..cd43877 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@@ -35,8 -38,8 +38,9 @@@ obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += obj-$(CONFIG_DUMP_CODE) += disassemble.o obj-$(CONFIG_HIBERNATION) += swsusp.o obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o + obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o +obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o EXTRA_CFLAGS += -Werror diff --cc arch/sh/kernel/process_32.c index 4a2c866,d8af889..7399d78 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c @@@ -193,15 -209,11 +207,10 @@@ int copy_thread(unsigned long clone_fla { struct thread_info *ti = task_thread_info(p); struct pt_regs *childregs; - struct task_struct *tsk = current; - - #if defined(CONFIG_SH_FPU) - unlazy_fpu(tsk, regs); - p->thread.fpu = tsk->thread.fpu; - copy_to_stopped_child_used_math(p); - #endif + #if defined(CONFIG_SH_DSP) + struct task_struct *tsk = current; -#endif + -#if defined(CONFIG_SH_DSP) if (is_dsp_enabled(tsk)) { /* We can use the __save_dsp or just copy the struct: * __save_dsp(p); @@@ -256,6 -316,33 +271,14 @@@ __switch_to(struct task_struct *prev, s : "r" (task_thread_info(next))); #endif - /* If no tasks are using the UBC, we're done */ - if (ubc_usercnt == 0) - /* If no tasks are using the UBC, we're done */; - else if (next->thread.ubc_pc && next->mm) { - int asid = 0; -#ifdef CONFIG_MMU - asid |= cpu_asid(smp_processor_id(), next->mm); -#endif - ubc_set_tracing(asid, next->thread.ubc_pc); - } else { -#if defined(CONFIG_CPU_SH4A) - ctrl_outl(UBC_CBR_INIT, UBC_CBR0); - ctrl_outl(UBC_CRR_INIT, UBC_CRR0); -#else - ctrl_outw(0, UBC_BBRA); - ctrl_outw(0, UBC_BBRB); -#endif - } - + /* + * If the task has used fpu the last 5 timeslices, just do a full + * restore of the math state immediately to avoid the trap; the + * chances of needing FPU soon are obviously high now + */ + if (next->fpu_counter > 5) + fpu_state_restore(task_pt_regs(next)); + return prev; }