aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 13:59:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 13:59:07 -0400
commitec0d7f18ab7b5097d7c0c8f3d909ca1031b9d5cd (patch)
tree7d62c924592145f819ecaa5d60460a05a10dfdbd /arch/sh
parent269af9a1a08d368b46d72e74126564d04c354f7e (diff)
parent1dcc8d7ba235a316a056f993e88f0d18b92c60d9 (diff)
Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/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()
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/processor_32.h3
-rw-r--r--arch/sh/include/asm/processor_64.h1
-rw-r--r--arch/sh/kernel/process.c7
-rw-r--r--arch/sh/kernel/process_32.c9
4 files changed, 7 insertions, 13 deletions
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h
index 900f8d72ffe2..b6311fd2d066 100644
--- a/arch/sh/include/asm/processor_32.h
+++ b/arch/sh/include/asm/processor_32.h
@@ -126,9 +126,6 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_pc, unsigned lo
126/* Free all resources held by a thread. */ 126/* Free all resources held by a thread. */
127extern void release_thread(struct task_struct *); 127extern void release_thread(struct task_struct *);
128 128
129/* Prepare to copy thread state - unlazy all lazy status */
130void prepare_to_copy(struct task_struct *tsk);
131
132/* 129/*
133 * create a kernel thread without removing it from tasklists 130 * create a kernel thread without removing it from tasklists
134 */ 131 */
diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h
index 740e26876596..cd6029fb2c01 100644
--- a/arch/sh/include/asm/processor_64.h
+++ b/arch/sh/include/asm/processor_64.h
@@ -169,7 +169,6 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
169#define copy_segments(p, mm) do { } while (0) 169#define copy_segments(p, mm) do { } while (0)
170#define release_segments(mm) do { } while (0) 170#define release_segments(mm) do { } while (0)
171#define forget_segments() do { } while (0) 171#define forget_segments() do { } while (0)
172#define prepare_to_copy(tsk) do { } while (0)
173/* 172/*
174 * FPU lazy state save handling. 173 * FPU lazy state save handling.
175 */ 174 */
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index e77feaf117ab..9b7a459a4613 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -13,8 +13,15 @@ unsigned long __stack_chk_guard __read_mostly;
13EXPORT_SYMBOL(__stack_chk_guard); 13EXPORT_SYMBOL(__stack_chk_guard);
14#endif 14#endif
15 15
16/*
17 * this gets called so that we can store lazy state into memory and copy the
18 * current task into the new thread.
19 */
16int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) 20int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
17{ 21{
22#ifdef CONFIG_SUPERH32
23 unlazy_fpu(src, task_pt_regs(src));
24#endif
18 *dst = *src; 25 *dst = *src;
19 26
20 if (src->thread.xstate) { 27 if (src->thread.xstate) {
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index f78cc421e665..59521e8a164d 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -156,15 +156,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
156} 156}
157EXPORT_SYMBOL(dump_fpu); 157EXPORT_SYMBOL(dump_fpu);
158 158
159/*
160 * This gets called before we allocate a new thread and copy
161 * the current task into it.
162 */
163void prepare_to_copy(struct task_struct *tsk)
164{
165 unlazy_fpu(tsk, task_pt_regs(tsk));
166}
167
168asmlinkage void ret_from_fork(void); 159asmlinkage void ret_from_fork(void);
169 160
170int copy_thread(unsigned long clone_flags, unsigned long usp, 161int copy_thread(unsigned long clone_flags, unsigned long usp,