diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-23 12:33:50 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 15:47:25 +0200 |
commit | ca6787ba0fcc875cfb06dc2a538ac23210b7d251 (patch) | |
tree | 3a638f47cff69fe217330fc67bc7dff1f7def7e5 /arch/x86/include/asm | |
parent | c5bedc6847c3be6efe0e671a6155c9a25fd468bf (diff) | |
download | lwn-ca6787ba0fcc875cfb06dc2a538ac23210b7d251.tar.gz lwn-ca6787ba0fcc875cfb06dc2a538ac23210b7d251.zip |
x86/fpu: Remove 'struct task_struct' usage from drop_fpu()
Migrate this function to pure 'struct fpu' usage.
Reviewed-by: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/fpu-internal.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 9311126571ab..e8f7134f0ffb 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -358,14 +358,13 @@ static inline void __thread_fpu_begin(struct fpu *fpu) __thread_set_has_fpu(fpu); } -static inline void drop_fpu(struct task_struct *tsk) +static inline void drop_fpu(struct fpu *fpu) { - struct fpu *fpu = &tsk->thread.fpu; /* * Forget coprocessor state.. */ preempt_disable(); - tsk->thread.fpu.counter = 0; + fpu->counter = 0; if (fpu->has_fpu) { /* Ignore delayed exceptions from user space */ @@ -394,8 +393,10 @@ static inline void restore_init_xstate(void) */ static inline void fpu_reset_state(struct task_struct *tsk) { + struct fpu *fpu = &tsk->thread.fpu; + if (!use_eager_fpu()) - drop_fpu(tsk); + drop_fpu(fpu); else restore_init_xstate(); } |