Re: [patch V3 49/66] x86/fpu: Move FXSAVE_LEAK quirk info __copy_kernel_to_fpregs()

From: Borislav Petkov
Date: Tue Jun 22 2021 - 11:58:49 EST


On Fri, Jun 18, 2021 at 04:19:12PM +0200, Thomas Gleixner wrote:
> copy_kernel_to_fpregs() restores all xfeatures but it is also the place
> where the AMD FXSAVE_LEAK bug is handled.
>
> That prevents fpregs_restore_userregs() to limit the restored features,
> which is required to distangle PKRU and XSTATE handling and also for the

"untangle"

> upcoming supervisor state management.
>
> Move the FXSAVE_LEAK quirk into __copy_kernel_to_fpregs() and deinline that
> function which has become rather fat.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> arch/x86/include/asm/fpu/internal.h | 25 +------------------------
> arch/x86/kernel/fpu/core.c | 27 +++++++++++++++++++++++++++
> 2 files changed, 28 insertions(+), 24 deletions(-)

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg