From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Huaitong Han <huaitong.han@intel.com>,
Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH v2 for-4.7] x86/cpuid: Calculate a guests xfeature_mask from its featureset
Date: Fri, 3 Jun 2016 15:40:27 +0100 [thread overview]
Message-ID: <575196DB.4080109@citrix.com> (raw)
In-Reply-To: <1464963068-8242-1-git-send-email-andrew.cooper3@citrix.com>
On 03/06/16 15:11, Andrew Cooper wrote:
> libxc current performs the xstate calculation for guests, and provides the
> information to Xen to be used when satisfying CPUID traps. (There is further
> work planned to improve this arrangement, but the worst a buggy toolstack can
> do is make junk appear in the cpuid leaves for the guest.)
>
> dom0 however has no policy constructed for it, and certain fields filter
> straight through from hardware.
>
> Linux queries CPUID.7[0].{EAX/EDX} alone to choose a setting for %xcr0, which
> is a valid action to take, but features such as MPX and PKRU are not supported
> for PV guests. As a result, Linux, using leaked hardware information, fails
> to set %xcr0 on newer Skylake hardware with PKRU support, and crashes.
>
> As an interim solution, dynamically calculate the correct xfeature_mask and
> xstate_size to report to the guest for CPUID.7[0] queries. This ensures that
> domains don't see leaked hardware values, even when no cpuid policy is
> provided.
>
> Similarly, CPUID.7[1]{ECX/EDX} represents the applicable settings for MSR_XSS.
> As Xen doesn't yet support any XSS states in guests, unconditionally zero
> them.
(sadly after pushing), it occurs to me that commit message is wrong. I
mean CPUID.0xD rather than CPUID.7
The code, and other information in the commit message, is correct.
Apologies.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
prev parent reply other threads:[~2016-06-03 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 14:11 [PATCH v2 for-4.7] x86/cpuid: Calculate a guests xfeature_mask from its featureset Andrew Cooper
2016-06-03 14:18 ` Wei Liu
2016-06-03 14:26 ` Jan Beulich
2016-06-03 14:40 ` Andrew Cooper [this message]
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=575196DB.4080109@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=huaitong.han@intel.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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;
as well as URLs for NNTP newsgroup(s).