lkml.org 
[lkml]   [2021]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-06-21 14:33    [W:0.881 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site