提交 dc56c0f9 编写于 作者: O Oleg Nesterov 提交者: H. Peter Anvin

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: NOleg Nesterov <oleg@redhat.com>
Link: http://lkml.kernel.org/r/20140902175730.GA21669@redhat.comReviewed-by: NSuresh Siddha <sbsiddha@gmail.com>
Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
上级 5e23fee2
...@@ -66,6 +66,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) ...@@ -66,6 +66,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
{ {
*dst = *src; *dst = *src;
dst->thread.fpu_counter = 0;
dst->thread.fpu.has_fpu = 0; dst->thread.fpu.has_fpu = 0;
dst->thread.fpu.last_cpu = ~0; dst->thread.fpu.last_cpu = ~0;
dst->thread.fpu.state = NULL; dst->thread.fpu.state = NULL;
......
...@@ -152,7 +152,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, ...@@ -152,7 +152,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
childregs->orig_ax = -1; childregs->orig_ax = -1;
childregs->cs = __KERNEL_CS | get_kernel_rpl(); childregs->cs = __KERNEL_CS | get_kernel_rpl();
childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED; childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
p->thread.fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL; p->thread.io_bitmap_ptr = NULL;
memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps)); memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
return 0; return 0;
...@@ -165,7 +164,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, ...@@ -165,7 +164,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
p->thread.ip = (unsigned long) ret_from_fork; p->thread.ip = (unsigned long) ret_from_fork;
task_user_gs(p) = get_user_gs(current_pt_regs()); task_user_gs(p) = get_user_gs(current_pt_regs());
p->thread.fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL; p->thread.io_bitmap_ptr = NULL;
tsk = current; tsk = current;
err = -ENOMEM; err = -ENOMEM;
......
...@@ -163,7 +163,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, ...@@ -163,7 +163,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
p->thread.sp = (unsigned long) childregs; p->thread.sp = (unsigned long) childregs;
p->thread.usersp = me->thread.usersp; p->thread.usersp = me->thread.usersp;
set_tsk_thread_flag(p, TIF_FORK); set_tsk_thread_flag(p, TIF_FORK);
p->thread.fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL; p->thread.io_bitmap_ptr = NULL;
savesegment(gs, p->thread.gsindex); savesegment(gs, p->thread.gsindex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册