From: Janet Liu Date: Thu, 11 Jun 2015 04:04:32 +0000 (+0800) Subject: arm64: kernel thread don't need to save fpsimd context. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6eb6c80187c55b7f95683bc6502dccac54b95b92;p=linux-beck.git arm64: kernel thread don't need to save fpsimd context. kernel thread's default fpsimd state is zero. When fork a thread, if parent is kernel thread, and save hardware context to parent's fpsimd state, but this hardware context is user process's context, because kernel thread don't use fpsimd, it will not introduce issue, it add a little cost. Signed-off-by: Janet Liu Signed-off-by: Chunyan Zhang Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 369f485f4b71..223b093c9440 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -233,7 +233,8 @@ void release_thread(struct task_struct *dead_task) int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) { - fpsimd_preserve_current_state(); + if (current->mm) + fpsimd_preserve_current_state(); *dst = *src; return 0; }