1
0
Fork 0
alistair23-linux/arch
Andy Lutomirski e45122893a 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
2021-01-21 12:07:28 +01:00
..
alpha local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
arc ARC: [hsdk]: Enable FPU_SAVE_RESTORE 2021-01-08 13:46:58 -08:00
arm ARM: SoC fixes for v5.11 2021-01-08 14:13:54 -08:00
arm64 x86: 2021-01-08 15:06:02 -08:00
c6x tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
csky local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
h8300 local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
hexagon local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
ia64 local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
m68k local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
microblaze local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
mips local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
nds32 local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
nios2 tif-task_work.arch-2020-12-14 2020-12-16 12:33:35 -08:00
openrisc local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
parisc local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
powerpc powerpc: Handle .text.{hot,unlikely}.* in linker script 2021-01-06 21:59:04 +11:00
riscv local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
s390 Merge branch 'kvm-master' into kvm-next 2021-01-07 18:06:52 -05:00
sh local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
sparc local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
um This pull request contains the following changes for UML: 2020-12-17 17:56:44 -08:00
x86 x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state 2021-01-21 12:07:28 +01:00
xtensa local64.h: make <asm/local64.h> mandatory 2020-12-29 15:36:49 -08:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2020-12-28 11:58:59 +01:00