summary refs log tree commit diff
path: root/ipc/mq_sysctl.c
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2021-01-20 21:09:48 -0800
committerBorislav Petkov <bp@suse.de>2021-01-21 12:07:28 +0100
commite45122893a9870813f9bd7b4add4f613e6f29008 (patch)
tree881341f1bc988ab97448b9a76f55121e13970252 /ipc/mq_sysctl.c
parent1eb8f690bcb565a6600f8b6dcc78f7b239ceba17 (diff)
downloadlinux-e45122893a9870813f9bd7b4add4f613e6f29008.tar.gz
x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state
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 state.  These users want MXCSR initialized but don't
   care about the FPU control word.  Skipping FNINIT would save time.
   (Empirically, FNINIT is several times slower than LDMXCSR.)

 - Code that wants MMX doesn't want or need MXCSR initialized.
   _mmx_memcpy(), for example, can run before CR4.OSFXSR gets set, and
   initializing MXCSR will fail because LDMXCSR generates an #UD when the
   aforementioned CR4 bit is not set.

 - Any future in-kernel users of XFD (eXtended Feature Disable)-capable
   dynamic states will need special handling.

Add a more specific API that allows callers to specify exactly what they
want.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Krzysztof Piotr Olędzki <ole@ans.pl>
Link: https://lkml.kernel.org/r/aff1cac8b8fc7ee900cf73e8f2369966621b053f.1611205691.git.luto@kernel.org
Diffstat (limited to 'ipc/mq_sysctl.c')
0 files changed, 0 insertions, 0 deletions