x86/fpu: Rename fxregs-related copy functions

The function names for fxsave/fxrstor operations are horribly named and
a permanent source of confusion.

Rename:
	copy_fxregs_to_kernel() to fxsave()
	copy_kernel_to_fxregs() to fxrstor()
	copy_fxregs_to_user() to fxsave_to_user_sigframe()
	copy_user_to_fxregs() to fxrstor_from_user_sigframe()

so it's clear what these are doing. All these functions are really low
level wrappers around the equally named instructions, so mapping to the
documentation is just natural.

While at it, replace the static_cpu_has(X86_FEATURE_FXSR) with
use_fxsr() to be consistent with the rest of the code.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121454.017863494@linutronix.de
This commit is contained in:
Thomas Gleixner
2021-06-23 14:01:54 +02:00
committed by Borislav Petkov
parent 6b862ba182
commit 16dcf43859
3 changed files with 13 additions and 21 deletions

View File

@@ -107,7 +107,7 @@ int copy_fpregs_to_fpstate(struct fpu *fpu)
}
if (likely(use_fxsr())) {
copy_fxregs_to_kernel(fpu);
fxsave(&fpu->state.fxsave);
return 1;
}
@@ -315,8 +315,8 @@ static inline void copy_init_fpstate_to_fpregs(u64 features_mask)
{
if (use_xsave())
os_xrstor(&init_fpstate.xsave, features_mask);
else if (static_cpu_has(X86_FEATURE_FXSR))
copy_kernel_to_fxregs(&init_fpstate.fxsave);
else if (use_fxsr())
fxrstor(&init_fpstate.fxsave);
else
copy_kernel_to_fregs(&init_fpstate.fsave);