]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Prepare fpu_clone() for dynamically enabled features
authorThomas Gleixner <tglx@linutronix.de>
Thu, 21 Oct 2021 22:55:14 +0000 (15:55 -0700)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Oct 2021 08:18:09 +0000 (10:18 +0200)
commitbb65e194b8fa335a1436ce069c5a214ddcc7d9e3
tree7fb104bf6f129909ec1d659032ed5038680b1951
parentd1ac06b8aad764e4b5ae60ce9bf2a89989a2496d
x86/fpu: Prepare fpu_clone() for dynamically enabled features

The default portion of the parent's FPU state is saved in a child task.
With dynamic features enabled, the non-default portion is not saved in a
child's fpstate because these register states are defined to be
caller-saved. The new task's fpstate is therefore the default buffer.

Fork inherits the permission of the parent.

Also, do not use memcpy() when TIF_NEED_FPU_LOAD is set because it is
invalid when the parent has dynamic features.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211021225527.10184-11-chang.seok.bae@intel.com
arch/x86/include/asm/fpu/sched.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/process.c