[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNIK632EfZXPQw5s@zn.tnic>
Date: Tue, 22 Jun 2021 18:08:11 +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 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@...utronix.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@...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