Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565317

Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area

From Dave Hansen <dave.hansen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area
Date 2017-01-23 22:30 +0100
Message-ID <t2Ulz-3fA-9@gated-at.bofh.it> (permalink)
References (3 earlier) <t2Q8i-qo-31@gated-at.bofh.it> <t2QBl-Qy-29@gated-at.bofh.it> <t2U2f-36U-69@gated-at.bofh.it> <t2UbU-3bl-39@gated-at.bofh.it> <t2Ulz-3fA-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/23/2017 01:16 PM, Yu-cheng Yu wrote:
> On Mon, Jan 23, 2017 at 01:10:20PM -0800, Dave Hansen wrote:
>> The code is:
>>
>>> void fpstate_init(union fpregs_state *state)
>>> {
>>>         if (!static_cpu_has(X86_FEATURE_FPU)) {
>>>                 fpstate_init_soft(&state->soft);
>>>                 return;
>>>         }
>>>
>>>         memset(state, 0, fpu_kernel_xstate_size);
>>>
>>>         /*
>>>          * XRSTORS requires that this bit is set in xcomp_bv, or
>>>          * it will #GP. Make sure it is replaced after the memset().
>>>          */
>>>         if (static_cpu_has(X86_FEATURE_XSAVES))
>>>                 state->xsave.header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT;
>>
>> That seems to set it unconditionally.  What am I missing?
> 
> The fix I am proposing is...
> 
> 	state->xsave.header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT |
> 				       xfeatures_mask;

Ahh, that makes sense.  That does indeed look like a bug in fpstate_init().

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86/fpu: set the xcomp_bv when we fake up a XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-22 10:00 +0100
  [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES  area tip-bot for Kevin Hao <tipbot@zytor.com> - 2017-01-23 09:30 +0100
    Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 16:40 +0100
      Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Yu-cheng Yu <yu-cheng.yu@intel.com> - 2017-01-23 18:00 +0100
        Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 18:30 +0100
          Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Yu-cheng Yu <yu-cheng.yu@intel.com> - 2017-01-23 22:10 +0100
            Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 22:20 +0100
              Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Yu-cheng Yu <yu-cheng.yu@intel.com> - 2017-01-23 22:30 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 22:30 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 01:20 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-24 02:00 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 03:00 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-24 03:10 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 03:20 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-24 03:40 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 06:20 +0100
                Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Ingo Molnar <mingo@kernel.org> - 2017-01-24 09:10 +0100
  [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES  area tip-bot for Kevin Hao <tipbot@zytor.com> - 2017-01-23 10:50 +0100

csiph-web