diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-10-15 03:16:04 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-10-20 15:27:26 +0200 |
commit | 2d16a1876f20218f8970ea4b7f679cead1cdb510 (patch) | |
tree | 1d87314e9523c5fe6d7c8e02b52b25f985871b99 /arch/x86 | |
parent | 01f9f62d3ae75077a54a11d2777082f1e58e2d9f (diff) | |
download | linux-2d16a1876f20218f8970ea4b7f679cead1cdb510.tar.gz linux-2d16a1876f20218f8970ea4b7f679cead1cdb510.tar.bz2 linux-2d16a1876f20218f8970ea4b7f679cead1cdb510.zip |
x86/process: Clone FPU in copy_thread()
There is no reason to clone FPU in arch_dup_task_struct(). Quite the
contrary - it prevents optimizations. Move it to copy_thread().
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211015011538.780714235@linutronix.de
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/process.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 1d9463e3096b..d2227c55e683 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -87,7 +87,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) #ifdef CONFIG_VM86 dst->thread.vm86 = NULL; #endif - return fpu_clone(dst); + return 0; } /* @@ -154,6 +154,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, frame->flags = X86_EFLAGS_FIXED; #endif + fpu_clone(p); + /* Kernel thread ? */ if (unlikely(p->flags & PF_KTHREAD)) { p->thread.pkru = pkru_get_init_value(); |