From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, "Liu, Jing2" <jing2.liu@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Bae, Chang Seok" <chang.seok.bae@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Arjan van de Ven <arjan@linux.intel.com>,
kvm@vger.kernel.org, "Nakajima, Jun" <jun.nakajima@intel.com>,
Sean Christopherson <seanjc@google.com>
Subject: [patch 4/4] x86/fpu: Remove old KVM FPU interface
Date: Sun, 17 Oct 2021 19:03:19 +0200 (CEST) [thread overview]
Message-ID: <20211017152048.726038584@linutronix.de> (raw)
In-Reply-To: <20211017151447.829495362@linutronix.de>
No more users.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/include/asm/fpu/api.h | 2 --
arch/x86/kernel/fpu/core.c | 32 --------------------------------
2 files changed, 34 deletions(-)
---
diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h
index 239909a95368..286a66ff0bd1 100644
--- a/arch/x86/include/asm/fpu/api.h
+++ b/arch/x86/include/asm/fpu/api.h
@@ -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, u64 restore_mask);
-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);
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 60681dc8a725..4b09f0f70082 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -248,29 +248,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)
{
@@ -440,15 +417,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)
{
next prev parent reply other threads:[~2021-10-17 17:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-17 17:03 [patch 0/4] x86/fpu/kvm: Sanitize the FPU guest/user handling Thomas Gleixner
2021-10-17 17:03 ` [patch 1/4] x86/fpu: Prepare for sanitizing KVM FPU code Thomas Gleixner
2021-10-17 17:03 ` [patch 2/4] x86/fpu: Provide infrastructure for KVM FPU cleanup Thomas Gleixner
2021-10-17 17:03 ` [patch 3/4] x86/kvm: Convert FPU handling to a single swap buffer Thomas Gleixner
2021-10-18 11:55 ` Paolo Bonzini
2021-10-17 17:03 ` Thomas Gleixner [this message]
2021-10-19 19:43 ` [patch 0/4] x86/fpu/kvm: Sanitize the FPU guest/user handling Bae, Chang Seok
2021-10-20 9:19 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211017152048.726038584@linutronix.de \
--to=tglx@linutronix.de \
--cc=arjan@linux.intel.com \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=jing2.liu@intel.com \
--cc=jun.nakajima@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®