lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 22 Jun 2021 01:00:14 +0200
From:   Borislav Petkov <bp@...e.de>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Fenghua Yu <fenghua.yu@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Yu-cheng Yu <yu-cheng.yu@...el.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Kan Liang <kan.liang@...ux.intel.com>
Subject: Re: [patch V3 29/66] x86/fpu: Rename fxregs related copy functions

On Fri, Jun 18, 2021 at 04:18:52PM +0200, Thomas Gleixner wrote:
> 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 equaly 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.

I think you mean with this...

> --- a/arch/x86/kernel/fpu/core.c
> +++ b/arch/x86/kernel/fpu/core.c
> @@ -107,7 +107,7 @@ int copy_fpregs_to_fpstate(struct fpu *f
>  	}
>  
>  	if (likely(use_fxsr())) {
> -		copy_fxregs_to_kernel(fpu);
> +		fxsave(&fpu->state.fxsave);
>  		return 1;
>  	}
>  
> @@ -360,7 +360,7 @@ static inline void copy_init_fpstate_to_
>  	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);
> +		fxrstor(&init_fpstate.fxsave);
>  	else
>  		copy_kernel_to_fregs(&init_fpstate.fsave);
>  

... this else if branch here. IOW, it should be:

	...
	else if (use_fxsr())
		fxrstor(&init_fpstate.fxsave);

		...


Gnight!

-- 
Regards/Gruss,
    Boris.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ