diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-09-02 13:57:30 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-09-02 17:51:16 -0400 |
commit | dc56c0f9b870fba7a4eef2bb463db6881284152b (patch) | |
tree | 4f557f5d3cbf778b98834cc247fd82027aec4604 | |
parent | 5e23fee23ea10730c752edce1777e6b7e727290f (diff) |
x86, fpu: Shift "fpu_counter = 0" from copy_thread() to arch_dup_task_struct()
Cosmetic, but I think thread.fpu_counter should be initialized in
arch_dup_task_struct() too, along with other "fpu" variables. And
probably it make sense to turn it into thread.fpu->counter.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20140902175730.GA21669@redhat.com
Reviewed-by: Suresh Siddha <sbsiddha@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | arch/x86/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/process_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/process_64.c | 1 |
3 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index a44268c897bd..e127ddaa2d5a 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -66,6 +66,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
66 | { | 66 | { |
67 | *dst = *src; | 67 | *dst = *src; |
68 | 68 | ||
69 | dst->thread.fpu_counter = 0; | ||
69 | dst->thread.fpu.has_fpu = 0; | 70 | dst->thread.fpu.has_fpu = 0; |
70 | dst->thread.fpu.last_cpu = ~0; | 71 | dst->thread.fpu.last_cpu = ~0; |
71 | dst->thread.fpu.state = NULL; | 72 | dst->thread.fpu.state = NULL; |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 7bc86bbe7485..c73b3c1a582b 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -152,7 +152,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
152 | childregs->orig_ax = -1; | 152 | childregs->orig_ax = -1; |
153 | childregs->cs = __KERNEL_CS | get_kernel_rpl(); | 153 | childregs->cs = __KERNEL_CS | get_kernel_rpl(); |
154 | childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED; | 154 | childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED; |
155 | p->thread.fpu_counter = 0; | ||
156 | p->thread.io_bitmap_ptr = NULL; | 155 | p->thread.io_bitmap_ptr = NULL; |
157 | memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); | 156 | memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); |
158 | return 0; | 157 | return 0; |
@@ -165,7 +164,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
165 | p->thread.ip = (unsigned long) ret_from_fork; | 164 | p->thread.ip = (unsigned long) ret_from_fork; |
166 | task_user_gs(p) = get_user_gs(current_pt_regs()); | 165 | task_user_gs(p) = get_user_gs(current_pt_regs()); |
167 | 166 | ||
168 | p->thread.fpu_counter = 0; | ||
169 | p->thread.io_bitmap_ptr = NULL; | 167 | p->thread.io_bitmap_ptr = NULL; |
170 | tsk = current; | 168 | tsk = current; |
171 | err = -ENOMEM; | 169 | err = -ENOMEM; |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index ca5b02d405c3..593257def776 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -163,7 +163,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
163 | p->thread.sp = (unsigned long) childregs; | 163 | p->thread.sp = (unsigned long) childregs; |
164 | p->thread.usersp = me->thread.usersp; | 164 | p->thread.usersp = me->thread.usersp; |
165 | set_tsk_thread_flag(p, TIF_FORK); | 165 | set_tsk_thread_flag(p, TIF_FORK); |
166 | p->thread.fpu_counter = 0; | ||
167 | p->thread.io_bitmap_ptr = NULL; | 166 | p->thread.io_bitmap_ptr = NULL; |
168 | 167 | ||
169 | savesegment(gs, p->thread.gsindex); | 168 | savesegment(gs, p->thread.gsindex); |