Re: [PATCH 1/4] x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state

2021-01-19 Thread Borislav Petkov
Just nitpicks: On Sun, Jan 17, 2021 at 10:20:38PM -0800, Andy Lutomirski wrote: > Currently, requesting kernel FPU access doesn't distinguish which parts of > the extended ("FPU") state are needed. This is nice for simplicity, but > there are a few cases in which it's suboptimal: > > - The

RE: [PATCH 1/4] x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state

2021-01-18 Thread David Laight
From: Andy Lutomirski > Sent: 18 January 2021 06:21 > > Currently, requesting kernel FPU access doesn't distinguish which parts of > the extended ("FPU") state are needed. This is nice for simplicity, but > there are a few cases in which it's suboptimal: > > - The vast majority of in-kernel

Re: [PATCH 1/4] x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state

2021-01-18 Thread Peter Zijlstra
On Sun, Jan 17, 2021 at 10:20:38PM -0800, Andy Lutomirski wrote: > - Code that wants MMX doesn't want need MXCSR or FCW initialized. >_mmx_memcpy(), for example, can run before CR4.OSFXSR gets set, and >initializing MXCSR will fail. > +#define KFPU_MMX 0 /* nothing

[PATCH 1/4] x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state

2021-01-17 Thread Andy Lutomirski
Currently, requesting kernel FPU access doesn't distinguish which parts of the extended ("FPU") state are needed. This is nice for simplicity, but there are a few cases in which it's suboptimal: - The vast majority of in-kernel FPU users want XMM/YMM/ZMM state but do not use legacy 387