Commit 727d0110 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Borislav Petkov
Browse files

x86/fpu: Rename __fpregs_load_activate() to fpregs_restore_userregs()



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: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121456.018867925@linutronix.de
parent 33344368
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size)
	 */
	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);