[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220609052342.1088435-1-kunyu@nfschina.com>
Date: Thu, 9 Jun 2022 13:23:42 +0800
From: Li kunyu <kunyu@...china.com>
To: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com
Cc: luto@...nel.org, linux-kernel@...r.kernel.org,
Li kunyu <kunyu@...china.com>
Subject: [PATCH] x86: fpu_clone function is changed to return type void
It is used to reduce the number of eax calls, improve the execution
efficiency, and use the same return type as fpu__drop and other
functions.
Signed-off-by: Li kunyu <kunyu@...china.com>
---
arch/x86/include/asm/fpu/sched.h | 2 +-
arch/x86/kernel/fpu/core.c | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/fpu/sched.h b/arch/x86/include/asm/fpu/sched.h
index b2486b2cbc6e..ca29fd8550ed 100644
--- a/arch/x86/include/asm/fpu/sched.h
+++ b/arch/x86/include/asm/fpu/sched.h
@@ -11,7 +11,7 @@
extern void save_fpregs_to_fpstate(struct fpu *fpu);
extern void fpu__drop(struct fpu *fpu);
-extern int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal);
+extern void fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal);
extern void fpu_flush_thread(void);
/*
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 0531d6a06df5..416dcdba992a 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -556,7 +556,7 @@ static inline void fpu_inherit_perms(struct fpu *dst_fpu)
}
/* Clone current's FPU state on fork */
-int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
+void fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
{
struct fpu *src_fpu = ¤t->thread.fpu;
struct fpu *dst_fpu = &dst->thread.fpu;
@@ -567,7 +567,7 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
fpstate_reset(dst_fpu);
if (!cpu_feature_enabled(X86_FEATURE_FPU))
- return 0;
+ return;
/*
* Enforce reload for user space tasks and prevent kernel threads
@@ -583,7 +583,7 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
/* Clear out the minimal state */
memcpy(&dst_fpu->fpstate->regs, &init_fpstate.regs,
init_fpstate_copy_size());
- return 0;
+ return;
}
/*
@@ -618,8 +618,6 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal)
trace_x86_fpu_copy_src(src_fpu);
trace_x86_fpu_copy_dst(dst_fpu);
-
- return 0;
}
/*
--
2.18.2
Powered by blists - more mailing lists