From: tip-bot for Oleg Nesterov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
sbsiddha@gmail.com, oleg@redhat.com, tglx@linutronix.de,
hpa@linux.intel.com
Subject: [tip:x86/fpu] x86, fpu: Shift "fpu_counter = 0" from copy_thread( ) to arch_dup_task_struct()
Date: Tue, 2 Sep 2014 15:19:44 -0700 [thread overview]
Message-ID: <tip-dc56c0f9b870fba7a4eef2bb463db6881284152b@git.kernel.org> (raw)
In-Reply-To: <20140902175730.GA21669@redhat.com>
Commit-ID: dc56c0f9b870fba7a4eef2bb463db6881284152b
Gitweb: http://git.kernel.org/tip/dc56c0f9b870fba7a4eef2bb463db6881284152b
Author: Oleg Nesterov <oleg@redhat.com>
AuthorDate: Tue, 2 Sep 2014 19:57:30 +0200
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 2 Sep 2014 14:51:16 -0700
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>
---
arch/x86/kernel/process.c | 1 +
arch/x86/kernel/process_32.c | 2 --
arch/x86/kernel/process_64.c | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index a44268c..e127dda 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)
{
*dst = *src;
+ dst->thread.fpu_counter = 0;
dst->thread.fpu.has_fpu = 0;
dst->thread.fpu.last_cpu = ~0;
dst->thread.fpu.state = NULL;
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 7bc86bb..c73b3c1 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,
childregs->orig_ax = -1;
childregs->cs = __KERNEL_CS | get_kernel_rpl();
childregs->flags = X86_EFLAGS_IF | X86_EFLAGS_FIXED;
- p->thread.fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL;
memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
return 0;
@@ -165,7 +164,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
p->thread.ip = (unsigned long) ret_from_fork;
task_user_gs(p) = get_user_gs(current_pt_regs());
- p->thread.fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL;
tsk = current;
err = -ENOMEM;
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index ca5b02d..593257d 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,
p->thread.sp = (unsigned long) childregs;
p->thread.usersp = me->thread.usersp;
set_tsk_thread_flag(p, TIF_FORK);
- p->thread.fpu_counter = 0;
p->thread.io_bitmap_ptr = NULL;
savesegment(gs, p->thread.gsindex);
next prev parent reply other threads:[~2014-09-02 22:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 17:56 [PATCH 0/7] x86, fpu: misc fixes/cleanups, more to come Oleg Nesterov
2014-09-02 17:57 ` [PATCH v2 1/7] x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal() Oleg Nesterov
2014-09-02 22:18 ` [tip:x86/fpu] " tip-bot for Oleg Nesterov
2014-09-02 17:57 ` [PATCH v2 2/7] x86, fpu: __restore_xstate_sig()->math_state_restore() needs preempt_disable() Oleg Nesterov
2014-09-02 22:18 ` [tip:x86/fpu] x86, fpu: __restore_xstate_sig()-> math_state_restore() " tip-bot for Oleg Nesterov
2014-09-02 17:57 ` [PATCH v2 3/7] x86, fpu: change __thread_fpu_begin() to use use_eager_fpu() Oleg Nesterov
2014-09-02 22:19 ` [tip:x86/fpu] x86, fpu: Change " tip-bot for Oleg Nesterov
2014-09-02 17:57 ` [PATCH v2 4/7] x86, fpu: copy_process: avoid fpu_alloc/copy if !used_math() Oleg Nesterov
2014-09-02 22:19 ` [tip:x86/fpu] x86, fpu: copy_process: Avoid fpu_alloc/ copy " tip-bot for Oleg Nesterov
2014-09-02 17:57 ` [PATCH v2 5/7] x86, fpu: copy_process: sanitize fpu->last_cpu initialization Oleg Nesterov
2014-09-02 22:19 ` [tip:x86/fpu] x86, fpu: copy_process: Sanitize fpu-> last_cpu initialization tip-bot for Oleg Nesterov
2014-09-02 17:57 ` [PATCH v2 6/7] x86, fpu: shift "fpu_counter = 0" from copy_thread() to arch_dup_task_struct() Oleg Nesterov
2014-09-02 22:19 ` tip-bot for Oleg Nesterov [this message]
2014-09-02 17:57 ` [PATCH v2 7/7] x86: copy_thread: don't nullify ->ptrace_bps twice Oleg Nesterov
2014-09-02 22:19 ` [tip:x86/fpu] x86: copy_thread: Don't " tip-bot for Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-dc56c0f9b870fba7a4eef2bb463db6881284152b@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=sbsiddha@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox