[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] a few questions about superpage support



On Fri, 2013-09-06 at 16:52 -0700, Antonin Bas wrote:
> Hi,
> 
> I am working on a project that relies on superpages within a guest. Of
> course these superpages need to be backed by actual machine pages.

Which type of guest are you running? Mosto f my reply is specific to HVM
which is what was implied by your interest in HAP.

There is no inherent need for things which are mapped as superpages in
the guest pagetables be also mapped as superpages in the p2m (e.g. HAP)
mappings. It is fine for a 2MB guest mapping to be translated via a
block of 4K mappings in the p2m (and vice versa).

Unless perhaps you mean that your usecase adds an additional
requirement?

> 
> I am using this version of Xen:
> (XEN) Xen version 4.2.2_04-0.7.5 (abuild@) (gcc (SUSE Linux) 4.3.4
> [gcc-4_3-branch revision 152973]) Fri Jun 14 12:22:34 UTC 2013
> 
> 
> HAP is enabled:
> ...
> (XEN) VMX: Supported advanced features:
> (XEN)  - APIC MMIO access virtualisation
> (XEN)  - APIC TPR shadow
> (XEN)  - Extended Page Tables (EPT)
> (XEN)  - Virtual-Processor Identifiers (VPID)
> (XEN)  - Virtual NMI
> (XEN)  - MSR direct-access bitmap
> (XEN)  - Unrestricted Guest
> (XEN)  - APIC Register Virtualization
> (XEN)  - Virtual Interrupt Delivery
> (XEN) HVM: ASIDs enabled.
> (XEN) HVM: VMX enabled
> (XEN) HVM: Hardware Assisted Paging (HAP) detected
> (XEN) HVM: HAP page sizes: 4kB, 2MB, 1GB
> ...
> 
> I am  using the boot line option allowsuperpage=1 and the guest config
> includes superpages=1

Is the former not a PV guest only thing?

And I can't see any code about the latter in the xl toolstack.

I thought superpages were the default, if any are available, for HVM
guests.

> 
> I have a few questions:
> 
> 1) How can I check that the the VMM is actually backing the 2M
> hugepages I request from within the guest with actual machine 2M
> hugepages. My first idea was to dump the EPT using 'xl debug D'.
> Unfortunately, it seems that the ring buffer for the console is not
> large enough and I cannot see all the entries with 'xl dmesg'. Even
> when I redirect the console output to /var/log/xen/console (using
> XENCONSOLED_TRACE="all" in /etc/sysconfig/xencommons), I am still
> missing entries. Is there a way to increase the ring size to see all
> the entries?

Yes, check the hypervisor command line argument documentation.

> With a guest memory of 4096, I can observe EPT entries that look like this:
> (XEN) gfn: 10f600            mfn: 306c00            order:  9  is_pod: 0
> At first I though they meant that guest 2M superpages were indeed
> being backed by 2M host machine superpages. I though this was weird
> since I could observe these entries even without explicitly requesting
> hugepages from within the guest. I set transparent hugepages in the
> guest to never (seems to be enabled by default in SUSE) but I could
> still observe these 'order: 9' entries, which means I don't actually
> know what they represent.

As I say above, the guest and p2m use of superpage mappings are
independent with HAP. And p2m superpages are the default for HVM.

> 2) 1GB superpage support. When I try to request 1GB in the guest at
> boot time, I get the following message from the kernel: "hugepagesz:
> Unsupported page size 1024 M", which is not a surprise since the
> pdpe1gb cpu flag is not enabled. How can I enable this flag for the
> domU vcpus? If this flag can be enabled, will the VMM try to map my
> guest 1GB superpages to host physical 1GB hugepage in the EPT?

Does your physical CPU support this?

The toolstacks have options for controlling the masking of guest visible
CPUID values. I'd be surprised if this particular wasn't passed through
to guests by default.

Ian.


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.