x86/fpu: Rename fpu__activate_fpstate_read/write() to fpu__prepare_[read|write]()
As per the new nomenclature we don't 'activate' the FPU state anymore, we initialize it. So drop the _activate_fpstate name from these functions, which were a bit of a mouthful anyway, and name them: fpu__prepare_read() fpu__prepare_write() Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Eric Biggers <ebiggers3@gmail.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -24,8 +24,8 @@
|
|||||||
* High level FPU state handling functions:
|
* High level FPU state handling functions:
|
||||||
*/
|
*/
|
||||||
extern void fpu__initialize(struct fpu *fpu);
|
extern void fpu__initialize(struct fpu *fpu);
|
||||||
extern void fpu__activate_fpstate_read(struct fpu *fpu);
|
extern void fpu__prepare_read(struct fpu *fpu);
|
||||||
extern void fpu__activate_fpstate_write(struct fpu *fpu);
|
extern void fpu__prepare_write(struct fpu *fpu);
|
||||||
extern void fpu__save(struct fpu *fpu);
|
extern void fpu__save(struct fpu *fpu);
|
||||||
extern void fpu__restore(struct fpu *fpu);
|
extern void fpu__restore(struct fpu *fpu);
|
||||||
extern int fpu__restore_sig(void __user *buf, int ia32_frame);
|
extern int fpu__restore_sig(void __user *buf, int ia32_frame);
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(fpu__initialize);
|
|||||||
*
|
*
|
||||||
* If the task has used the FPU before then save it.
|
* If the task has used the FPU before then save it.
|
||||||
*/
|
*/
|
||||||
void fpu__activate_fpstate_read(struct fpu *fpu)
|
void fpu__prepare_read(struct fpu *fpu)
|
||||||
{
|
{
|
||||||
if (fpu == ¤t->thread.fpu) {
|
if (fpu == ¤t->thread.fpu) {
|
||||||
fpu__save(fpu);
|
fpu__save(fpu);
|
||||||
@@ -283,7 +283,7 @@ void fpu__activate_fpstate_read(struct fpu *fpu)
|
|||||||
* state pending on its former CPU could be restored, corrupting
|
* state pending on its former CPU could be restored, corrupting
|
||||||
* the modifications.
|
* the modifications.
|
||||||
*/
|
*/
|
||||||
void fpu__activate_fpstate_write(struct fpu *fpu)
|
void fpu__prepare_write(struct fpu *fpu)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Only stopped child tasks can be used to modify the FPU
|
* Only stopped child tasks can be used to modify the FPU
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
|
|||||||
if (!boot_cpu_has(X86_FEATURE_FXSR))
|
if (!boot_cpu_has(X86_FEATURE_FXSR))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
fpu__activate_fpstate_read(fpu);
|
fpu__prepare_read(fpu);
|
||||||
fpstate_sanitize_xstate(fpu);
|
fpstate_sanitize_xstate(fpu);
|
||||||
|
|
||||||
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
|
||||||
@@ -55,7 +55,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
|
|||||||
if (!boot_cpu_has(X86_FEATURE_FXSR))
|
if (!boot_cpu_has(X86_FEATURE_FXSR))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
fpu__activate_fpstate_write(fpu);
|
fpu__prepare_write(fpu);
|
||||||
fpstate_sanitize_xstate(fpu);
|
fpstate_sanitize_xstate(fpu);
|
||||||
|
|
||||||
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
|
||||||
@@ -89,7 +89,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
|
|||||||
|
|
||||||
xsave = &fpu->state.xsave;
|
xsave = &fpu->state.xsave;
|
||||||
|
|
||||||
fpu__activate_fpstate_read(fpu);
|
fpu__prepare_read(fpu);
|
||||||
|
|
||||||
if (using_compacted_format()) {
|
if (using_compacted_format()) {
|
||||||
if (kbuf)
|
if (kbuf)
|
||||||
@@ -132,7 +132,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
|
|||||||
|
|
||||||
xsave = &fpu->state.xsave;
|
xsave = &fpu->state.xsave;
|
||||||
|
|
||||||
fpu__activate_fpstate_write(fpu);
|
fpu__prepare_write(fpu);
|
||||||
|
|
||||||
if (boot_cpu_has(X86_FEATURE_XSAVES)) {
|
if (boot_cpu_has(X86_FEATURE_XSAVES)) {
|
||||||
if (kbuf)
|
if (kbuf)
|
||||||
@@ -310,7 +310,7 @@ int fpregs_get(struct task_struct *target, const struct user_regset *regset,
|
|||||||
struct fpu *fpu = &target->thread.fpu;
|
struct fpu *fpu = &target->thread.fpu;
|
||||||
struct user_i387_ia32_struct env;
|
struct user_i387_ia32_struct env;
|
||||||
|
|
||||||
fpu__activate_fpstate_read(fpu);
|
fpu__prepare_read(fpu);
|
||||||
|
|
||||||
if (!boot_cpu_has(X86_FEATURE_FPU))
|
if (!boot_cpu_has(X86_FEATURE_FPU))
|
||||||
return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
|
return fpregs_soft_get(target, regset, pos, count, kbuf, ubuf);
|
||||||
@@ -340,7 +340,7 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
|
|||||||
struct user_i387_ia32_struct env;
|
struct user_i387_ia32_struct env;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
fpu__activate_fpstate_write(fpu);
|
fpu__prepare_write(fpu);
|
||||||
fpstate_sanitize_xstate(fpu);
|
fpstate_sanitize_xstate(fpu);
|
||||||
|
|
||||||
if (!boot_cpu_has(X86_FEATURE_FPU))
|
if (!boot_cpu_has(X86_FEATURE_FPU))
|
||||||
|
|||||||
Reference in New Issue
Block a user