aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/fpu/internal.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-06-23 14:02:06 +0200
committerBorislav Petkov <bp@suse.de>2021-06-23 18:55:56 +0200
commitb2681e791dbcee6acb1dca7a5076a0285109ac4c (patch)
treee6088e639d8357c09620ef2d0ddca4cb1dfc1a64 /arch/x86/include/asm/fpu/internal.h
parentx86/pkeys: Move read_pkru() and write_pkru() (diff)
downloadlinux-dev-b2681e791dbcee6acb1dca7a5076a0285109ac4c.tar.xz
linux-dev-b2681e791dbcee6acb1dca7a5076a0285109ac4c.zip
x86/fpu: Rename and sanitize fpu__save/copy()
Both function names are a misnomer. fpu__save() is actually about synchronizing the hardware register state into the task's memory state so that either coredump or a math exception handler can inspect the state at the time where the problem happens. The function guarantees to preserve the register state, while "save" is a common terminology for saving the current state so it can be modified and restored later. This is clearly not the case here. Rename it to fpu_sync_fpstate(). fpu__copy() is used to clone the current task's FPU state when duplicating task_struct. While the register state is a copy the rest of the FPU state is not. Name it accordingly and remove the really pointless @src argument along with the warning which comes along with it. Nothing can ever copy the FPU state of a non-current task. It's clearly just a consequence of arch_dup_task_struct(), but it makes no sense to proliferate that further. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20210623121455.196727450@linutronix.de
Diffstat (limited to 'arch/x86/include/asm/fpu/internal.h')
-rw-r--r--arch/x86/include/asm/fpu/internal.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h
index 3558cd05c62f..f5da2e9b87da 100644
--- a/arch/x86/include/asm/fpu/internal.h
+++ b/arch/x86/include/asm/fpu/internal.h
@@ -26,14 +26,16 @@
/*
* High level FPU state handling functions:
*/
-extern void fpu__save(struct fpu *fpu);
extern int fpu__restore_sig(void __user *buf, int ia32_frame);
extern void fpu__drop(struct fpu *fpu);
-extern int fpu__copy(struct task_struct *dst, struct task_struct *src);
extern void fpu__clear_user_states(struct fpu *fpu);
extern void fpu__clear_all(struct fpu *fpu);
extern int fpu__exception_code(struct fpu *fpu, int trap_nr);
+extern void fpu_sync_fpstate(struct fpu *fpu);
+
+extern int fpu_clone(struct task_struct *dst);
+
/*
* Boot time FPU initialization functions:
*/