From: Linus Torvalds Date: Wed, 23 May 2012 17:59:07 +0000 (-0700) Subject: Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ec0d7f18ab7b5097d7c0c8f3d909ca1031b9d5cd;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Merge branch 'x86-fpu-for-linus' of git://git./linux/kernel/git/tip/tip Pull fpu state cleanups from Ingo Molnar: "This tree streamlines further aspects of FPU handling by eliminating the prepare_to_copy() complication and moving that logic to arch_dup_task_struct(). It also fixes the FPU dumps in threaded core dumps, removes and old (and now invalid) assumption plus micro-optimizes the exit path by avoiding an FPU save for dead tasks." Fixed up trivial add-add conflict in arch/sh/kernel/process.c that came in because we now do the FPU handling in arch_dup_task_struct() rather than the legacy (and now gone) prepare_to_copy(). * 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, fpu: drop the fpu state during thread exit x86, xsave: remove thread_has_fpu() bug check in __sanitize_i387_state() coredump: ensure the fpu state is flushed for proper multi-threaded core dump fork: move the real prepare_to_copy() users to arch_dup_task_struct() --- ec0d7f18ab7b5097d7c0c8f3d909ca1031b9d5cd diff --cc arch/sh/kernel/process.c index e77feaf117ab,2bde59eae10d..9b7a459a4613 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@@ -8,13 -6,15 +8,20 @@@ struct kmem_cache *task_xstate_cachep = NULL; unsigned int xstate_size; +#ifdef CONFIG_CC_STACKPROTECTOR +unsigned long __stack_chk_guard __read_mostly; +EXPORT_SYMBOL(__stack_chk_guard); +#endif + + /* + * this gets called so that we can store lazy state into memory and copy the + * current task into the new thread. + */ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) { + #ifdef CONFIG_SUPERH32 + unlazy_fpu(src, task_pt_regs(src)); + #endif *dst = *src; if (src->thread.xstate) { diff --cc arch/x86/kernel/process.c index f2e8c0f951d6,1219fe2be8f3..735279e54e59 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@@ -111,8 -119,16 +127,10 @@@ void exit_thread(void put_cpu(); kfree(bp); } + + drop_fpu(me); } -void show_regs(struct pt_regs *regs) -{ - show_registers(regs); - show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs), 0); -} - void show_regs_common(void) { const char *vendor, *product, *board;