| Date | Mon, 21 Jun 2021 14:32:18 +0200 | From | Borislav Petkov <> | Subject | Re: [patch V3 17/66] x86/fpu: Make copy_xstate_to_kernel() usable for [x]fpregs_get() |
| |
On Fri, Jun 18, 2021 at 04:18:40PM +0200, Thomas Gleixner wrote: > When xsave with init state optimization is used then a component's state > in the task's xsave buffer can be stale when the corresponding feature bit > is not set. > > fpregs_get() and xfpregs_get() invoke fpstate_sanitize_xstate() to update > the task's xsave buffer before retrieving the FX or FP state. That's just > duplicated code as copy_xstate_to_kernel() already handles this correctly. > > Add a copy mode argument to the function which allows to restrict the state > copy to the FP and SSE features. > > Also rename the function to copy_xstate_to_uabi_buf() so the name reflects > what it is doing. > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de> > --- > V3: Rename to copy_xstate_to_uabi_buf() - Boris > V2: New patch > --- > arch/x86/include/asm/fpu/xstate.h | 12 +++++++++- > arch/x86/kernel/fpu/regset.c | 2 - > arch/x86/kernel/fpu/xstate.c | 42 ++++++++++++++++++++++++++++---------- > 3 files changed, 42 insertions(+), 14 deletions(-)
Reviewed-by: Borislav Petkov <bp@suse.de>
-- Regards/Gruss, Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
|