diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-06-23 15:01:51 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-06-23 18:53:31 +0300 |
commit | 1f3171252dc586745bb548d48f3bcedfea34b58d (patch) | |
tree | ecd2505dd43d3255d2a49498e1312fbd3d0162c4 /arch/x86/include/asm/fpu/xstate.h | |
parent | 9fe8a6f5eed8fff6b2d7dbc99b911334e311732d (diff) | |
download | linux-1f3171252dc586745bb548d48f3bcedfea34b58d.tar.xz |
x86/fpu: Get rid of copy_supervisor_to_kernel()
If the fast path of restoring the FPU state on sigreturn fails or is not
taken and the current task's FPU is active then the FPU has to be
deactivated for the slow path to allow a safe update of the tasks FPU
memory state.
With supervisor states enabled, this requires to save the supervisor state
in the memory state first. Supervisor states require XSAVES so saving only
the supervisor state requires to reshuffle the memory buffer because XSAVES
uses the compacted format and therefore stores the supervisor states at the
beginning of the memory state. That's just an overengineered optimization.
Get rid of it and save the full state for this case.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121453.734561971@linutronix.de
Diffstat (limited to 'arch/x86/include/asm/fpu/xstate.h')
-rw-r--r-- | arch/x86/include/asm/fpu/xstate.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/x86/include/asm/fpu/xstate.h b/arch/x86/include/asm/fpu/xstate.h index 6e5ba42ffd42..6611e069e834 100644 --- a/arch/x86/include/asm/fpu/xstate.h +++ b/arch/x86/include/asm/fpu/xstate.h @@ -104,7 +104,6 @@ void *get_xsave_addr(struct xregs_state *xsave, int xfeature_nr); int xfeature_size(int xfeature_nr); int copy_kernel_to_xstate(struct xregs_state *xsave, const void *kbuf); int copy_user_to_xstate(struct xregs_state *xsave, const void __user *ubuf); -void copy_supervisor_to_kernel(struct xregs_state *xsave); void copy_dynamic_supervisor_to_kernel(struct xregs_state *xstate, u64 mask); void copy_kernel_to_dynamic_supervisor(struct xregs_state *xstate, u64 mask); |