Skip to content

Commit

Permalink
x86/fpu: Remove old KVM FPU interface
Browse files Browse the repository at this point in the history
No more users.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
KAGA-KOKO authored and suryasaimadhu committed Oct 23, 2021
1 parent d69c138 commit 582b01b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
2 changes: 0 additions & 2 deletions arch/x86/include/asm/fpu/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ static inline void fpstate_init_soft(struct swregs_state *soft) {}
DECLARE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);

/* fpstate-related functions which are exported to KVM */
extern void fpu_init_fpstate_user(struct fpu *fpu);
extern void fpstate_clear_xstate_component(struct fpstate *fps, unsigned int xfeature);

/* KVM specific functions */
extern bool fpu_alloc_guest_fpstate(struct fpu_guest *gfpu);
extern void fpu_free_guest_fpstate(struct fpu_guest *gfpu);
extern int fpu_swap_kvm_fpstate(struct fpu_guest *gfpu, bool enter_guest);
extern void fpu_swap_kvm_fpu(struct fpu *save, struct fpu *rstor, u64 restore_mask);

extern void fpu_copy_guest_fpstate_to_uabi(struct fpu_guest *gfpu, void *buf, unsigned int size, u32 pkru);
extern int fpu_copy_uabi_to_guest_fpstate(struct fpu_guest *gfpu, const void *buf, u64 xcr0, u32 *vpkru);
Expand Down
32 changes: 0 additions & 32 deletions arch/x86/kernel/fpu/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,6 @@ int fpu_swap_kvm_fpstate(struct fpu_guest *guest_fpu, bool enter_guest)
}
EXPORT_SYMBOL_GPL(fpu_swap_kvm_fpstate);

void fpu_swap_kvm_fpu(struct fpu *save, struct fpu *rstor, u64 restore_mask)
{
fpregs_lock();

if (save) {
struct fpstate *fpcur = current->thread.fpu.fpstate;

if (test_thread_flag(TIF_NEED_FPU_LOAD))
memcpy(&save->fpstate->regs, &fpcur->regs, fpcur->size);
else
save_fpregs_to_fpstate(save);
}

if (rstor) {
restore_mask &= XFEATURE_MASK_FPSTATE;
restore_fpregs_from_fpstate(rstor->fpstate, restore_mask);
}

fpregs_mark_activate();
fpregs_unlock();
}
EXPORT_SYMBOL_GPL(fpu_swap_kvm_fpu);

void fpu_copy_guest_fpstate_to_uabi(struct fpu_guest *gfpu, void *buf,
unsigned int size, u32 pkru)
{
Expand Down Expand Up @@ -437,15 +414,6 @@ void fpstate_reset(struct fpu *fpu)
__fpstate_reset(fpu->fpstate);
}

#if IS_ENABLED(CONFIG_KVM)
void fpu_init_fpstate_user(struct fpu *fpu)
{
fpstate_reset(fpu);
fpstate_init_user(fpu->fpstate);
}
EXPORT_SYMBOL_GPL(fpu_init_fpstate_user);
#endif

/* Clone current's FPU state on fork */
int fpu_clone(struct task_struct *dst)
{
Expand Down

0 comments on commit 582b01b

Please sign in to comment.