]> git.karo-electronics.de Git - linux-beck.git/commit
x86/fpu: Factor out FPU hw activation/deactivation
authorIngo Molnar <mingo@kernel.org>
Mon, 27 Apr 2015 06:58:45 +0000 (08:58 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:47:52 +0000 (15:47 +0200)
commit32b49b3c83cad1ba60494a00dad2f511a647fb5a
tree9b0c0491ed64ffd7e7b855eabce1fcafbe94d611
parent67ee658e6fb8611a64dd8406b0081b1fba9dec1b
x86/fpu: Factor out FPU hw activation/deactivation

We have repeat patterns of:

if (!use_eager_fpu())
clts();

... to activate FPU registers, and:

if (!use_eager_fpu())
stts();

... to deactivate them.

Encapsulate these in:

__fpregs_activate_hw();
__fpregs_activate_hw();

and use them accordingly.

Doing this synchronizes the idiom with the fpu->fpregs_active
software-flag's handling functions, creating clear patterns of:

__fpregs_activate_hw();
__fpregs_activate(fpu);

etc., which improves readability.

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>
arch/x86/include/asm/fpu/internal.h
arch/x86/kernel/fpu/core.c