lkml.org 
[lkml]   [2017]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area
On Mon, Jan 23, 2017 at 07:36:20AM -0800, Dave Hansen wrote:
> The kernel xsave buffer should *ALWAYS* have the
> XCOMP_BV_COMPACTED_FORMAT bit set. It should have been set before the
> copyin and it should be set when it's finished.
>
> The best fix here would be not to paper over the issue in the copy
> function but find where it got clobbered, or where some initialization
> code failed to set it.

Someone else reported different issues from the same bug and a different
patch was just tested OK this morning. I think that adding xfeatures bits
to xcomp_bv should have been done in fpstate_init().

Also, in copy_init_fpstate_to_fpregs(), we do:

copy_kernel_to_xregs(&init_fpstate.xsave, -1).

That (-1) could mean (0) because the parameters are declared as:

copy_kernel_to_xregs(struct xregs_state *, u64)

Yu-cheng

\
 
 \ /
  Last update: 2017-01-23 17:59    [W:0.090 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site