[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <163473748230.25758.15564811556603342279.tip-bot2@tip-bot2>
Date: Wed, 20 Oct 2021 13:44:42 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...e.de>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/fpu] x86/process: Clone FPU in copy_thread()
The following commit has been merged into the x86/fpu branch of tip:
Commit-ID: 2d16a1876f20218f8970ea4b7f679cead1cdb510
Gitweb: https://git.kernel.org/tip/2d16a1876f20218f8970ea4b7f679cead1cdb510
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Fri, 15 Oct 2021 03:16:04 +02:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Wed, 20 Oct 2021 15:27:26 +02:00
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@...utronix.de>
Signed-off-by: Borislav Petkov <bp@...e.de>
Link: https://lkml.kernel.org/r/20211015011538.780714235@linutronix.de
---
arch/x86/kernel/process.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 1d9463e..d2227c5 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();
Powered by blists - more mailing lists