• Ingo Molnar's avatar
    x86/fpu: Factor out FPU hw activation/deactivation · 32b49b3c
    Ingo Molnar authored
    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: default avatarBorislav 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: default avatarIngo Molnar <mingo@kernel.org>
    32b49b3c
core.c 16.7 KB