Skip to content

Commit

Permalink
x86/fpu: Rename initstate copy functions
Browse files Browse the repository at this point in the history
Again this not a copy. It's restoring register state from kernel memory.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121454.816581630@linutronix.de
  • Loading branch information
Thomas Gleixner authored and Borislav Petkov committed Jun 23, 2021
1 parent 1c61fad commit b76411b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kernel/fpu/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void fpu__drop(struct fpu *fpu)
* Clear FPU registers by setting them up from the init fpstate.
* Caller must do fpregs_[un]lock() around it.
*/
static inline void copy_init_fpstate_to_fpregs(u64 features_mask)
static inline void restore_fpregs_from_init_fpstate(u64 features_mask)
{
if (use_xsave())
os_xrstor(&init_fpstate.xsave, features_mask);
Expand Down Expand Up @@ -338,9 +338,9 @@ static void fpu__clear(struct fpu *fpu, bool user_only)
if (!fpregs_state_valid(fpu, smp_processor_id()) &&
xfeatures_mask_supervisor())
os_xrstor(&fpu->state.xsave, xfeatures_mask_supervisor());
copy_init_fpstate_to_fpregs(xfeatures_mask_user());
restore_fpregs_from_init_fpstate(xfeatures_mask_user());
} else {
copy_init_fpstate_to_fpregs(xfeatures_mask_all);
restore_fpregs_from_init_fpstate(xfeatures_mask_all);
}

fpregs_mark_activate();
Expand Down

0 comments on commit b76411b

Please sign in to comment.