[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNCG0kNJMJ/khoOG@zn.tnic>
Date: Mon, 21 Jun 2021 14:32:18 +0200
From: Borislav Petkov <bp@...e.de>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Tony Luck <tony.luck@...el.com>,
Yu-cheng Yu <yu-cheng.yu@...el.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Kan Liang <kan.liang@...ux.intel.com>
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@...utronix.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@...e.de>
--
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
Powered by blists - more mailing lists