From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tim Deegan <tim@xen.org>
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com, Liang Li <liang.z.li@intel.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
yang.z.zhang@intel.com
Subject: Re: [PATCH] libxc: Expose the pdpe1gb cpuid flag to guest
Date: Mon, 17 Nov 2014 17:25:17 +0000 [thread overview]
Message-ID: <546A2F7D.8050507@citrix.com> (raw)
In-Reply-To: <20141117170032.GB29684@deinos.phlegethon.org>
On 17/11/14 17:00, Tim Deegan wrote:
> At 16:40 +0000 on 17 Nov (1416238835), Andrew Cooper wrote:
>> On 17/11/14 16:30, Tim Deegan wrote:
>>> At 16:24 +0000 on 17 Nov (1416237888), Jan Beulich wrote:
>>>>>>> On 17.11.14 at 16:39, <Ian.Jackson@eu.citrix.com> wrote:
>>>>> Liang Li writes ("[PATCH] libxc: Expose the pdpe1gb cpuid flag to guest"):
>>>>>> If hardware support the pdpe1gb flag, expose it to guest by default.
>>>>>> Users don't have to use a 'cpuid= ' option in config file to turn
>>>>>> it on.
>>>>> I don't understand what this flag does. I guess from the name it
>>>>> turns on 1G pages. I guess these are supported ?
>>>>>
>>>>> I would like to see comment from an x86 hypervisor maintainer.
>>>> Yes, we support 1Gb pages. The purpose of the patch is to not
>>>> unconditionally hide the flag from guests. (I had commented on
>>>> v1, but sadly this one wasn't tagged as v2, nor was I included on
>>>> the Cc list, hence I didn't spot the new version.)
>>>>
>>>> The one thing I'm not certain about is shadow mode: Only 2Mb
>>>> pages may be supported there. Tim?
>>> Indeed, only 2MiB pages are supported in shadow mode. See, e.g.
>>> guest_supports_1G_superpages()->hvm_pse1gb_supported()->paging_mode_hap()
>> This is yet another case which proves that libxc is the wrong place to
>> be choosing the cpuid flags exposed to a domain.
>>
>> Furthermore, guest_supports_1G_superpages() is insufficient as it only
>> checks whether the host is capable of providing 1G superpages, not
>> whether the guest has been permitted to use it.
>>
>> This causes a problem when migrating between hap-capable and
>> hap-incapable systems.
> There's no notion of 'permitted' to use 1G pages, AFAICS, much like
> other CPU features. But of course a _well-behaved_ guest that has
> been told in cpuid not to use 1G superpages will have no problems. :)
That is my point.
If 1GB pages are not supported (i.e. not present in cpuid), then the PS
bit in an L3 is reserved, must be 0, and cause a pagefault if used.
Nothing in Xen currently enforces this because
guest_supports_1G_superpages() doesn't check domain_cpuid().
It does however make me wonder how VMX/SVM non-root mode would enforce
this as it would see the host cpuid, not guest cpuid when performing
paging internally.
~Andrew
next prev parent reply other threads:[~2014-11-17 17:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 5:16 [PATCH] libxc: Expose the pdpe1gb cpuid flag to guest Liang Li
2014-11-17 15:39 ` Ian Jackson
2014-11-17 16:24 ` Jan Beulich
2014-11-17 16:30 ` Tim Deegan
2014-11-17 16:40 ` Andrew Cooper
2014-11-17 17:00 ` Tim Deegan
2014-11-17 17:25 ` Andrew Cooper [this message]
2014-11-18 10:14 ` Tim Deegan
2014-11-18 10:43 ` Andrew Cooper
2014-11-18 11:41 ` Zhang, Yang Z
2014-11-18 14:26 ` Ian Campbell
2014-11-18 15:15 ` Tim Deegan
2014-11-19 1:29 ` Zhang, Yang Z
2014-11-19 9:54 ` Tim Deegan
2014-11-25 1:47 ` Zhang, Yang Z
2014-11-25 8:20 ` Jan Beulich
2014-11-26 0:40 ` Zhang, Yang Z
2014-11-28 0:34 ` Li, Liang Z
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=546A2F7D.8050507@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=ian.campbell@citrix.com \
--cc=liang.z.li@intel.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=yang.z.zhang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.