[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2be814b7-9fd6-7955-b4e3-6ecb4ef76052@linux.intel.com>
Date: Mon, 23 Jan 2017 09:23:06 -0800
From: Dave Hansen <dave.hansen@...ux.intel.com>
To: Yu-cheng Yu <yu-cheng.yu@...el.com>
Cc: fenghua.yu@...el.com, dvlasenk@...hat.com, peterz@...radead.org,
oleg@...hat.com, mingo@...nel.org, linux-kernel@...r.kernel.org,
brgerst@...il.com, luto@...nel.org, bp@...en8.de,
jpoimboe@...hat.com, haokexin@...il.com, hpa@...or.com,
quentin.casasnovas@...cle.com, tglx@...utronix.de,
torvalds@...ux-foundation.org, riel@...hat.com,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a
XSAVES area
On 01/23/2017 08:55 AM, Yu-cheng Yu wrote:
> 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().
Right. So where did it get cleared out?
> 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)
I'm not sure what you're saying. -1 just means "all 1's" when cast to
an unsigned type. This shouldn't case any problems.
Powered by blists - more mailing lists