diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-18 11:58:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-18 11:58:16 -0400 |
commit | 41d59102e146a4423a490b8eca68a5860af4fe1c (patch) | |
tree | 739ed4113ccdaeb33d1723a6beab09c1e18d7048 /arch/x86/kernel/process.c | |
parent | 3e1dd193edefd2a806a0ba6cf0879cf1a95217da (diff) | |
parent | c9775b4cc522e5f1b40b1366a993f0f05f600f39 (diff) |
Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, fpu: Use static_cpu_has() to implement use_xsave()
x86: Add new static_cpu_has() function using alternatives
x86, fpu: Use the proper asm constraint in use_xsave()
x86, fpu: Unbreak FPU emulation
x86: Introduce 'struct fpu' and related API
x86: Eliminate TS_XSAVE
x86-32: Don't set ignore_fpu_irq in simd exception
x86: Merge kernel_math_error() into math_error()
x86: Merge simd_math_error() into math_error()
x86-32: Rework cache flush denied handler
Fix trivial conflict in arch/x86/kernel/process.c
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index cc6877535ef4..e7e35219b32f 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -31,24 +31,22 @@ struct kmem_cache *task_xstate_cachep; | |||
31 | 31 | ||
32 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | 32 | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) |
33 | { | 33 | { |
34 | int ret; | ||
35 | |||
34 | *dst = *src; | 36 | *dst = *src; |
35 | if (src->thread.xstate) { | 37 | if (fpu_allocated(&src->thread.fpu)) { |
36 | dst->thread.xstate = kmem_cache_alloc(task_xstate_cachep, | 38 | memset(&dst->thread.fpu, 0, sizeof(dst->thread.fpu)); |
37 | GFP_KERNEL); | 39 | ret = fpu_alloc(&dst->thread.fpu); |
38 | if (!dst->thread.xstate) | 40 | if (ret) |
39 | return -ENOMEM; | 41 | return ret; |
40 | WARN_ON((unsigned long)dst->thread.xstate & 15); | 42 | fpu_copy(&dst->thread.fpu, &src->thread.fpu); |
41 | memcpy(dst->thread.xstate, src->thread.xstate, xstate_size); | ||
42 | } | 43 | } |
43 | return 0; | 44 | return 0; |
44 | } | 45 | } |
45 | 46 | ||
46 | void free_thread_xstate(struct task_struct *tsk) | 47 | void free_thread_xstate(struct task_struct *tsk) |
47 | { | 48 | { |
48 | if (tsk->thread.xstate) { | 49 | fpu_free(&tsk->thread.fpu); |
49 | kmem_cache_free(task_xstate_cachep, tsk->thread.xstate); | ||
50 | tsk->thread.xstate = NULL; | ||
51 | } | ||
52 | } | 50 | } |
53 | 51 | ||
54 | void free_thread_info(struct thread_info *ti) | 52 | void free_thread_info(struct thread_info *ti) |