x86/fpu: Rename user_has_fpu() to fpregs_active()
authorIngo Molnar <mingo@kernel.org>
Tue, 28 Apr 2015 10:28:08 +0000 (12:28 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 May 2015 13:48:02 +0000 (15:48 +0200)
Rename this function in line with the new FPU nomenclature.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
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/xstate.c
arch/x86/kvm/vmx.c
drivers/lguest/x86/core.c

index 58c274dfcb62433d3ebd6ecffb15350d9bef1c0e..0f17cd4e4e58945abc3d218ecbacb84163fba8ba 100644 (file)
@@ -358,7 +358,7 @@ static inline void __fpregs_activate(struct fpu *fpu)
  * to save the FP state - we'll just take a #NM
  * fault and get the FPU access back.
  */
-static inline int user_has_fpu(void)
+static inline int fpregs_active(void)
 {
        return current->thread.fpu.fpregs_active;
 }
@@ -557,7 +557,7 @@ static inline void user_fpu_begin(void)
        struct fpu *fpu = &current->thread.fpu;
 
        preempt_disable();
-       if (!user_has_fpu())
+       if (!fpregs_active())
                fpregs_activate(fpu);
        preempt_enable();
 }
index 28638820ed0e0790b2f3880b6cdb2a845008f3db..b8e5fee2aef38f7b874cf6bd9d2664a0a1ddcd09 100644 (file)
@@ -310,7 +310,7 @@ int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size)
                        sizeof(struct user_i387_ia32_struct), NULL,
                        (struct _fpstate_ia32 __user *) buf) ? -1 : 1;
 
-       if (user_has_fpu()) {
+       if (fpregs_active()) {
                /* Save the live register state to the user directly. */
                if (copy_fpregs_to_sigframe(buf_fx))
                        return -1;
index 2de55e9538428846e18084afddabfeb92df5183c..1c384bf856e5adb005530a8f608fa9314bfa5de1 100644 (file)
@@ -1882,7 +1882,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
         * If the FPU is not active (through the host task or
         * the guest vcpu), then restore the cr0.TS bit.
         */
-       if (!user_has_fpu() && !vmx->vcpu.guest_fpu_loaded)
+       if (!fpregs_active() && !vmx->vcpu.guest_fpu_loaded)
                stts();
        load_gdt(this_cpu_ptr(&host_gdt));
 }
index b80e4b8c9b6e40262bc786ebd6df112ddc072cdc..99bb3009e2d5f1b7ab5dc48d824707d97828c532 100644 (file)
@@ -251,7 +251,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
         * we set it now, so we can trap and pass that trap to the Guest if it
         * uses the FPU.
         */
-       if (cpu->ts && user_has_fpu())
+       if (cpu->ts && fpregs_active())
                stts();
 
        /*
@@ -283,7 +283,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
                wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);
 
        /* Clear the host TS bit if it was set above. */
-       if (cpu->ts && user_has_fpu())
+       if (cpu->ts && fpregs_active())
                clts();
 
        /*
@@ -301,7 +301,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
         * a different CPU. So all the critical stuff should be done
         * before this.
         */
-       else if (cpu->regs->trapnum == 7 && !user_has_fpu())
+       else if (cpu->regs->trapnum == 7 && !fpregs_active())
                fpu__restore();
 }