x86/fpu: Rename __fpregs_load_activate() to fpregs_restore_userregs()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 23 Jun 2021 12:02:14 +0000 (14:02 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 23 Jun 2021 17:23:40 +0000 (19:23 +0200)
Rename it so that it becomes entirely clear what this function is
about. It's purpose is to restore the FPU registers to the state which was
saved in the task's FPU memory state either at context switch or by an in
kernel FPU user.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121456.018867925@linutronix.de
arch/x86/include/asm/fpu/internal.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/fpu/signal.c

index dabbb700c0ebd8b298fd10715b3cd0149f4df78a..f7688f6e86bcee8f63c100c09fea133306d02cce 100644 (file)
@@ -465,10 +465,8 @@ static inline void fpregs_activate(struct fpu *fpu)
        trace_x86_fpu_regs_activated(fpu);
 }
 
-/*
- * Internal helper, do not use directly. Use switch_fpu_return() instead.
- */
-static inline void __fpregs_load_activate(void)
+/* Internal helper for switch_fpu_return() and signal frame setup */
+static inline void fpregs_restore_userregs(void)
 {
        struct fpu *fpu = &current->thread.fpu;
        int cpu = smp_processor_id();
index aa7e808b9d1e15a0d12c8bdcb74a20bb1101072a..6babf18763898223bd48a35652e8109da877bd3f 100644 (file)
@@ -402,7 +402,7 @@ void switch_fpu_return(void)
        if (!static_cpu_has(X86_FEATURE_FPU))
                return;
 
-       __fpregs_load_activate();
+       fpregs_restore_userregs();
 }
 EXPORT_SYMBOL_GPL(switch_fpu_return);
 
index fd4b58d7b72ee6ffbffa99054bf9eb4eb6dbe388..b12665c38a302634c2d6df05455241ccd089be82 100644 (file)
@@ -188,7 +188,7 @@ retry:
         */
        fpregs_lock();
        if (test_thread_flag(TIF_NEED_FPU_LOAD))
-               __fpregs_load_activate();
+               fpregs_restore_userregs();
 
        pagefault_disable();
        ret = copy_fpregs_to_sigframe(buf_fx);