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]
Message-ID: <8c8d91ae-5a3b-9523-725d-134840102df7@kernel.org>
Date:   Sun, 23 May 2021 20:09:13 -0700
From:   Andy Lutomirski <luto@...nel.org>
To:     "Chang S. Bae" <chang.seok.bae@...el.com>, bp@...e.de,
        tglx@...utronix.de, mingo@...nel.org, x86@...nel.org
Cc:     len.brown@...el.com, dave.hansen@...el.com, jing2.liu@...el.com,
        ravi.v.shankar@...el.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 21/28] x86/fpu/amx: Initialize child's AMX state

On 5/23/21 12:32 PM, Chang S. Bae wrote:
> Assure that a forked child starts AMX registers in the INIT-state.
> 
> Signed-off-by: Chang S. Bae <chang.seok.bae@...el.com>
> Reviewed-by: Len Brown <len.brown@...el.com>
> Cc: x86@...nel.org
> Cc: linux-kernel@...r.kernel.org
> ---
> Changes from v4:
> * Added as a new patch. This was missing on previous versions.
> ---
>  arch/x86/kernel/fpu/core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
> index 016c3adebec3..cccfeafe81e5 100644
> --- a/arch/x86/kernel/fpu/core.c
> +++ b/arch/x86/kernel/fpu/core.c
> @@ -285,6 +285,10 @@ int fpu__copy(struct task_struct *dst, struct task_struct *src)
>  
>  	fpregs_unlock();
>  
> +	/* AMX state is volatile, children do not inherit it. */
> +	if (xfeatures_mask_all & XFEATURE_MASK_XTILE)
> +		dst_fpu->state->xsave.header.xfeatures &= ~(XFEATURE_MASK_XTILE);
> +
>  	set_tsk_thread_flag(dst, TIF_NEED_FPU_LOAD);
>  
>  	trace_x86_fpu_copy_src(src_fpu);
> 

If we're going to start having different states with different
behaviors, let's make them real defines.

#define XFEATURE_MASK_CLEARED_ON_CLONE ...

--Andy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ