From: Dave Hansen <dave.hansen@linux.intel.com>
To: fenghua.yu@intel.com, dvlasenk@redhat.com, peterz@infradead.org,
oleg@redhat.com, mingo@kernel.org, linux-kernel@vger.kernel.org,
brgerst@gmail.com, yu-cheng.yu@intel.com, luto@kernel.org,
bp@alien8.de, jpoimboe@redhat.com, haokexin@gmail.com,
hpa@zytor.com, quentin.casasnovas@oracle.com, tglx@linutronix.de,
torvalds@linux-foundation.org, riel@redhat.com,
linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area
Date: Mon, 23 Jan 2017 07:36:20 -0800 [thread overview]
Message-ID: <f2fb890d-f8ff-69e2-acc7-b3c810d6cf02@linux.intel.com> (raw)
In-Reply-To: <tip-5fa356458b5c918bdf8307b070a3d74bc015d910@git.kernel.org>
On 01/23/2017 12:28 AM, tip-bot for Kevin Hao wrote:
> x86/fpu: Set the xcomp_bv when we fake up a XSAVES area
>
> I got the following calltrace on a Apollo Lake SoC with 32-bit kernel:
...
> --- a/arch/x86/kernel/fpu/xstate.c
> +++ b/arch/x86/kernel/fpu/xstate.c
> @@ -1070,6 +1070,7 @@ int copyin_to_xsaves(const void *kbuf, const void __user *ubuf,
> * Add back in the features that came in from userspace:
> */
> xsave->header.xfeatures |= xfeatures;
> + xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xsave->header.xfeatures;
>
> return 0;
> }
First of all, thanks for finding this! As you found, the 32-bit XSAVES
code is a bit light on testing.
I don't doubt that we have a code path that was screwed up like this,
but I don't think this is the right fix.
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.
next prev parent reply other threads:[~2017-01-23 15:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-22 8:50 [PATCH] x86/fpu: set " Kevin Hao
2017-01-23 8:28 ` [tip:x86/urgent] x86/fpu: Set " tip-bot for Kevin Hao
2017-01-23 15:36 ` Dave Hansen [this message]
2017-01-23 16:55 ` Yu-cheng Yu
2017-01-23 17:23 ` Dave Hansen
2017-01-23 20:57 ` Yu-cheng Yu
2017-01-23 21:10 ` Dave Hansen
2017-01-23 21:16 ` Yu-cheng Yu
2017-01-23 21:28 ` Dave Hansen
2017-01-24 0:14 ` Kevin Hao
2017-01-24 0:53 ` Dave Hansen
2017-01-24 1:50 ` Kevin Hao
2017-01-24 2:01 ` Dave Hansen
2017-01-24 2:09 ` Kevin Hao
2017-01-24 2:38 ` Dave Hansen
2017-01-24 5:18 ` Kevin Hao
2017-01-24 8:08 ` Ingo Molnar
2017-01-23 9:43 ` tip-bot for Kevin Hao
2017-02-14 16:47 ` Dave Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2fb890d-f8ff-69e2-acc7-b3c810d6cf02@linux.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=fenghua.yu@intel.com \
--cc=haokexin@gmail.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=quentin.casasnovas@oracle.com \
--cc=riel@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=yu-cheng.yu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome