lkml.org 
[lkml]   [2021]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V3 27/66] x86/fpu: Rename copy_xregs_to_kernel() and copy_kernel_to_xregs()
On Fri, Jun 18, 2021 at 04:18:50PM +0200, Thomas Gleixner wrote:
> The function names for xsave[s]/xrstor[s] operations are horribly named and
> a permanent source of confusion.
>
> Rename:
> copy_xregs_to_kernel() to os_xsave()
> copy_kernel_to_xregs() to os_xrstor()
>
> These are truly low level wrappers around the actual instructions
> XSAVE[OPT]/XRSTOR and XSAVES/XRSTORS with the twist that the selection
> based on the available CPU features happens with an alternative to avoid
> conditionals all over the place and to provide the best performance for hot
> pathes.

"paths".

You need more elisp magic here. :)

> @@ -385,7 +390,7 @@ extern int copy_fpregs_to_fpstate(struct
> static inline void __copy_kernel_to_fpregs(union fpregs_state *fpstate, u64 mask)
> {
> if (use_xsave()) {
> - copy_kernel_to_xregs(&fpstate->xsave, mask);
> + os_xrstor(&fpstate->xsave, mask);

Yeah, this reads funny now:

if use xsave, then xrstor.

and then later

if use xsave, then xsave.

where latter makes perfect sense but former makes you stop and think for
a bit.

:-)

Regardless, it is still move in the right direction.

Reviewed-by: Borislav Petkov <bp@suse.de>

--
Regards/Gruss,
Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg

\
 
 \ /
  Last update: 2021-06-21 20:05    [W:0.528 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site