diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-03-03 12:12:15 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-03 12:12:15 +0100 |
commit | ae486033b980346eb6a77240101210cb66924a91 (patch) | |
tree | 923e255abef680d1354c3e18df2044f19d6dbcbb /arch/x86/kernel/i387.c | |
parent | f353e612304ba752d6b613dc02eae8116cd3e27b (diff) | |
parent | 110d7f7513bbb916b8654da9e2973ac5bed929a9 (diff) | |
download | op-kernel-dev-ae486033b980346eb6a77240101210cb66924a91.zip op-kernel-dev-ae486033b980346eb6a77240101210cb66924a91.tar.gz |
Merge tag 'tip_x86_fpu' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp into x86/fpu
Pull x86/fpu updates from Borislav Petkov:
"Three more cleanups/improvements to the FPU handling code. (Oleg Nesterov)"
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/i387.c')
-rw-r--r-- | arch/x86/kernel/i387.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index f59d806..8416b5f 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -41,8 +41,8 @@ void kernel_fpu_enable(void) * be set (so that the clts/stts pair does nothing that is * visible in the interrupted kernel thread). * - * Except for the eagerfpu case when we return 1 unless we've already - * been eager and saved the state in kernel_fpu_begin(). + * Except for the eagerfpu case when we return true; in the likely case + * the thread has FPU but we are not going to set/clear TS. */ static inline bool interrupted_kernel_fpu_idle(void) { @@ -50,7 +50,7 @@ static inline bool interrupted_kernel_fpu_idle(void) return false; if (use_eager_fpu()) - return __thread_has_fpu(current); + return true; return !__thread_has_fpu(current) && (read_cr0() & X86_CR0_TS); @@ -93,9 +93,10 @@ void __kernel_fpu_begin(void) if (__thread_has_fpu(me)) { __save_init_fpu(me); - } else if (!use_eager_fpu()) { + } else { this_cpu_write(fpu_owner_task, NULL); - clts(); + if (!use_eager_fpu()) + clts(); } } EXPORT_SYMBOL(__kernel_fpu_begin); |