aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-03-14 06:52:12 -0400
committerIngo Molnar <mingo@kernel.org>2015-03-23 05:13:59 -0400
commitd2d0ac9a4644e00120bb9b7427a512a99d2cacc5 (patch)
tree6a4fffbfa475d79e0487c492c357396c096d2fb9
parentf893959b0898bd876673adbeb6798bdf25c034d7 (diff)
x86/fpu: Fold __drop_fpu() into its sole user
Fold it into drop_fpu(). Phew, one less FPU function to pay attention to. No functionality change. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Pekka Riikonen <priikone@iki.fi> Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com> Cc: Rik van Riel <riel@redhat.com> Cc: Suresh Siddha <sbsiddha@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/fpu-internal.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h
index 7d2f7fa6b2dd..2d4adff428ac 100644
--- a/arch/x86/include/asm/fpu-internal.h
+++ b/arch/x86/include/asm/fpu-internal.h
@@ -378,8 +378,14 @@ static inline void __thread_fpu_begin(struct task_struct *tsk)
378 __thread_set_has_fpu(tsk); 378 __thread_set_has_fpu(tsk);
379} 379}
380 380
381static inline void __drop_fpu(struct task_struct *tsk) 381static inline void drop_fpu(struct task_struct *tsk)
382{ 382{
383 /*
384 * Forget coprocessor state..
385 */
386 preempt_disable();
387 tsk->thread.fpu_counter = 0;
388
383 if (__thread_has_fpu(tsk)) { 389 if (__thread_has_fpu(tsk)) {
384 /* Ignore delayed exceptions from user space */ 390 /* Ignore delayed exceptions from user space */
385 asm volatile("1: fwait\n" 391 asm volatile("1: fwait\n"
@@ -387,16 +393,7 @@ static inline void __drop_fpu(struct task_struct *tsk)
387 _ASM_EXTABLE(1b, 2b)); 393 _ASM_EXTABLE(1b, 2b));
388 __thread_fpu_end(tsk); 394 __thread_fpu_end(tsk);
389 } 395 }
390}
391 396
392static inline void drop_fpu(struct task_struct *tsk)
393{
394 /*
395 * Forget coprocessor state..
396 */
397 preempt_disable();
398 tsk->thread.fpu_counter = 0;
399 __drop_fpu(tsk);
400 clear_stopped_child_used_math(tsk); 397 clear_stopped_child_used_math(tsk);
401 preempt_enable(); 398 preempt_enable();
402} 399}