Skip to content

Commit

Permalink
x86/fpu: Rename fpu__activate_curr() to fpu__initialize()
Browse files Browse the repository at this point in the history
Rename this function to better express that it's all about
initializing the FPU state of a task which goes hand in hand
with the fpu::initialized field.

Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Eric Biggers <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Yu-cheng Yu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Sep 26, 2017
1 parent e10078e commit 2ce03d8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/fpu/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/*
* High level FPU state handling functions:
*/
extern void fpu__activate_curr(struct fpu *fpu);
extern void fpu__initialize(struct fpu *fpu);
extern void fpu__activate_fpstate_read(struct fpu *fpu);
extern void fpu__activate_fpstate_write(struct fpu *fpu);
extern void fpu__save(struct fpu *fpu);
Expand Down
8 changes: 4 additions & 4 deletions arch/x86/kernel/fpu/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu)
* Activate the current task's in-memory FPU context,
* if it has not been used before:
*/
void fpu__activate_curr(struct fpu *fpu)
void fpu__initialize(struct fpu *fpu)
{
WARN_ON_FPU(fpu != &current->thread.fpu);

Expand All @@ -237,7 +237,7 @@ void fpu__activate_curr(struct fpu *fpu)
fpu->initialized = 1;
}
}
EXPORT_SYMBOL_GPL(fpu__activate_curr);
EXPORT_SYMBOL_GPL(fpu__initialize);

/*
* This function must be called before we read a task's fpstate.
Expand Down Expand Up @@ -316,7 +316,7 @@ void fpu__activate_fpstate_write(struct fpu *fpu)
*/
void fpu__restore(struct fpu *fpu)
{
fpu__activate_curr(fpu);
fpu__initialize(fpu);

/* Avoid __kernel_fpu_begin() right after fpregs_activate() */
kernel_fpu_disable();
Expand Down Expand Up @@ -392,7 +392,7 @@ void fpu__clear(struct fpu *fpu)
*/
if (static_cpu_has(X86_FEATURE_FPU)) {
preempt_disable();
fpu__activate_curr(fpu);
fpu__initialize(fpu);
user_fpu_begin();
copy_init_fpstate_to_fpregs();
preempt_enable();
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/fpu/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
if (!access_ok(VERIFY_READ, buf, size))
return -EACCES;

fpu__activate_curr(fpu);
fpu__initialize(fpu);

if (!static_cpu_has(X86_FEATURE_FPU))
return fpregs_soft_set(current, NULL,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -7225,7 +7225,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
int r;
sigset_t sigsaved;

fpu__activate_curr(fpu);
fpu__initialize(fpu);

if (vcpu->sigset_active)
sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/math-emu/fpu_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void math_emulate(struct math_emu_info *info)
struct desc_struct code_descriptor;
struct fpu *fpu = &current->thread.fpu;

fpu__activate_curr(fpu);
fpu__initialize(fpu);

#ifdef RE_ENTRANT_CHECKING
if (emulating) {
Expand Down

0 comments on commit 2ce03d8

Please sign in to comment.