lkml.org 
[lkml]   [2021]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V3 51/66] x86/fpu: Dont restore PKRU in fpregs_restore_userspace()
On Fri, Jun 18, 2021 at 04:19:14PM +0200, Thomas Gleixner wrote:
> switch_to(), flush_thread() write the task's PKRU value eagerly so the PKRU
> value of current is always valid in the hardware.
>
> That means there is no point in restoring PKRU on exit to user or when
> reactivating the task's FPU registers in the signal frame setup path.
>
> This allows to remove all the xstate buffer updates with PKRU values once
> the PKRU state is stored in thread struct while a task is scheduled out.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> V3: Restore supervisor state too. (Yu-Cheng)
> ---
> arch/x86/include/asm/fpu/internal.h | 16 +++++++++++++++-
> arch/x86/include/asm/fpu/xstate.h | 19 +++++++++++++++++++
> arch/x86/kernel/fpu/core.c | 2 +-
> 3 files changed, 35 insertions(+), 2 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-22 18:08    [W:1.484 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site