lkml.org 
[lkml]   [2015]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 30/34] x86, fpu: allow setting of XSAVE state
On Thu, 3 Dec 2015, Dave Hansen wrote:

>
> From: Dave Hansen <dave.hansen@linux.intel.com>
>
> We want to modify the Protection Key rights inside the kernel, so
> we need to change PKRU's contents. But, if we do a plain
> 'wrpkru', when we return to userspace we might do an XRSTOR and
> wipe out the kernel's 'wrpkru'. So, we need to go after PKRU in
> the xsave buffer.
>
> We do this by:
> 1. Ensuring that we have the XSAVE registers (fpregs) in the
> kernel FPU buffer (fpstate)
> 2. Looking up the location of a given state in the buffer
> 3. Filling in the stat
> 4. Ensuring that the hardware knows that state is present there
> (basically that the 'init optimization' is not in place).
> 5. Copying the newly-modified state back to the registers if
> necessary.
>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>


\
 
 \ /
  Last update: 2015-12-08 20:21    [W:1.475 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site