Re: [patch V3 57/66] x86/pkru: Remove xstate fiddling from write_pkru()

From: Borislav Petkov
Date: Tue Jun 22 2021 - 13:15:27 EST


On Fri, Jun 18, 2021 at 04:19:20PM +0200, Thomas Gleixner wrote:
> The PKRU value of a task is stored in task->thread.pkru when the task is
> scheduled out. PKRU is restored on schedule in from there. So keeping the
> XSAVE buffer up to date is a pointless exercise.
>
> Remove the xstate fiddling and cleanup all related functions.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> arch/x86/include/asm/pkru.h | 17 ++++-------------
> arch/x86/include/asm/special_insns.h | 14 +-------------
> arch/x86/kvm/x86.c | 4 ++--
> 3 files changed, 7 insertions(+), 28 deletions(-)

Yap, untangling PKRU from XSAVE makes the related code a lot nicer, I
gotta say.

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

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