lkml.org 
[lkml]   [2015]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH Bugfix v2 2/4] x86/xsaves: Define and use user_xstate_size for xstate size in signal context
On 04/21/2015 09:51 PM, Fenghua Yu wrote:
> + /*
> + * Clear xcomp_bv[63] in user's xsave area header to indicate
> + * buf_fx is in standard format.
> + */
> + xcomp_bv = xsave->xsave_hdr.xcomp_bv;
> + user_xsave = buf_fx;
> + xcomp_bv &= ~((u64)1 << 63);

I ran in to another bug. xrestor_user() is hitting a #GP with these values:

[ 6.258743] xrestore_user() tmp: ffff88003f813000
[ 6.261122] XCR0: 000000000000001f
[ 6.261868] xstate_bv: 0000000000000003
[ 6.262613] xcomp_bv: 000000000000001f

I think it is because bit 63 is clear in xcomp_bv, but there are other
bits set in there.

I think the above needs to just do:

/*
* We are uncompacting the state for the user buffer. We need
* to clear out the xcomp_bv field entirely. The uncompacted
* form of xsave/xrstor treats this field as reserved.
*/
if (__put_user(0, &user_xsave->xsave_hdr.xcomp_bv))
return -1;




\
 
 \ /
  Last update: 2015-04-29 00:41    [W:0.095 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site