From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] libxc: Expose the pdpe1gb cpuid flag to guest Date: Mon, 17 Nov 2014 16:40:35 +0000 Message-ID: <546A2503.4000302@citrix.com> References: <1416201409-7462-1-git-send-email-liang.z.li@intel.com> <21610.5784.968036.992847@mariner.uk.xensource.com> <546A2F600200007800048848@mail.emea.novell.com> <20141117163017.GA29684@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141117163017.GA29684@deinos.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan , Jan Beulich Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, Liang Li , Ian Jackson , xen-devel@lists.xen.org, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org 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, 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. I do hope to fix all of this with my planned changes to the cpuid infrastructure. ~Andrew