summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorJanet Liu <janet.liu@spreadtrum.com>2015-06-11 04:04:32 (GMT)
committerCatalin Marinas <catalin.marinas@arm.com>2015-06-11 14:35:23 (GMT)
commit6eb6c80187c55b7f95683bc6502dccac54b95b92 (patch)
treec6346a9942633d97031f6edfc0a04bb315a8e95b /arch/arm64
parent04d7e098f541769721d7511d56aea4b976fd29fd (diff)
downloadlinux-6eb6c80187c55b7f95683bc6502dccac54b95b92.tar.xz
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 <janet.liu@spreadtrum.com> Signed-off-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/process.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 369f485..223b093 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;
}