mbox

[Xen-devel,v3,0/8] xen: arm: Use super pages in p2m

Message ID 1403777793.16595.21.camel@kazak.uk.xensource.com
State New
Headers show

Pull-request

git://xenbits.xen.org/people/ianc/xen.git arm-p2m-superpages-v3

Message

Ian Campbell June 26, 2014, 10:16 a.m. UTC
The following series adds support for superpage mappings (1G and 2M) in
the p2m for dom0 and domU.

At the moment it is not possible to allocate 1G regions to guests,
because this is gated on multipage_allocation_permitted() which
currently (incorrectly) returns false for dom0 on ARM. This is fixed by
Arianna's "arch/arm: domain build: let dom0 access I/O memory of mapped
devices" (which initialises iomem_caps for dom0).

On a 32-bit platform this causes the overhead of kernbench vs. native to
drop from 8-9% to 1.5-3% (it's basically the same for both dom0 and
domU).

I couldn't get my 64-bit platform to boot natively for some reason but
in absolute terms kernbench improved by ~5% (domU) to ~15% (dom0).

A   xen: arm: dump vcpu gic info in arch_dump_vcpu_info
At  tools/libxc: pull min/max_t into xc_private.h
At  tools: arm: allocate large pages to guests.
A   xen: arm: only put_page for p2m operations which require it.
A   xen: arm: handle superpage mappings in p2m_lookup
m   xen: arm: add some helpers for assessing p2m pte
m   xen: arm: use superpages in p2m when pages are suitably aligned
m   xen: arm: allocate more than one bank for 1:1 domain 0 if needed

A == ARM ack
t == Tools ACK still needed
m == non-trivial modifications this round

Ian.

The following changes since commit 1c9d2acad014e997771c09d75bc071db754d2f4b:

  QEMU_TAG update (2014-06-25 15:58:02 +0100)

are available in the git repository at:

  git://xenbits.xen.org/people/ianc/xen.git arm-p2m-superpages-v3

for you to fetch changes up to b9efd403d4107eeb40a5b9950204d68b2fd20563:

  xen: arm: allocate more than one bank for 1:1 domain 0 if needed (2014-06-26 11:13:26 +0100)

----------------------------------------------------------------
Ian Campbell (8):
      xen: arm: dump vcpu gic info in arch_dump_vcpu_info
      tools/libxc: pull min/max_t into xc_private.h
      tools: arm: allocate large pages to guests.
      xen: arm: only put_page for p2m operations which require it.
      xen: arm: handle superpage mappings in p2m_lookup
      xen: arm: add some helpers for assessing p2m pte
      xen: arm: use superpages in p2m when pages are suitably aligned
      xen: arm: allocate more than one bank for 1:1 domain 0 if needed

 tools/libxc/xc_dom_arm.c                  |  119 ++++++-
 tools/libxc/xc_dom_decompress_unsafe_xz.c |    5 -
 tools/libxc/xc_private.h                  |    5 +
 xen/arch/arm/domain.c                     |    8 +-
 xen/arch/arm/domain_build.c               |  286 +++++++++++++--
 xen/arch/arm/p2m.c                        |  544 ++++++++++++++++++++++-------
 xen/include/asm-arm/p2m.h                 |   12 +
 7 files changed, 798 insertions(+), 181 deletions(-)

Comments

Julien Grall June 26, 2014, 3:03 p.m. UTC | #1
Hi Ian,

On 06/26/2014 11:16 AM, Ian Campbell wrote:
> The following series adds support for superpage mappings (1G and 2M) in
> the p2m for dom0 and domU.
> 
> At the moment it is not possible to allocate 1G regions to guests,
> because this is gated on multipage_allocation_permitted() which
> currently (incorrectly) returns false for dom0 on ARM.

OOI, why multipage_allocation_permitted is gated with iomem_caps?

It looks wrong to me, as mapping an MMIO region in the guest will allow
him to use 1G mapping.

> This is fixed by
> Arianna's "arch/arm: domain build: let dom0 access I/O memory of mapped
> devices" (which initialises iomem_caps for dom0).

IIRC, this has been pushed a month ago on upstream.

Regards,
Ian Campbell June 30, 2014, 3:44 p.m. UTC | #2
On Thu, 2014-06-26 at 16:03 +0100, Julien Grall wrote:
> Hi Ian,
> 
> On 06/26/2014 11:16 AM, Ian Campbell wrote:
> > The following series adds support for superpage mappings (1G and 2M) in
> > the p2m for dom0 and domU.
> > 
> > At the moment it is not possible to allocate 1G regions to guests,
> > because this is gated on multipage_allocation_permitted() which
> > currently (incorrectly) returns false for dom0 on ARM.
> 
> OOI, why multipage_allocation_permitted is gated with iomem_caps?

I don't really know.

I think it relates to the old PV x86 world where if you had a piece of
hardware passed through it might also be considered reasonable to allow
you to allocate larger contiguous buffers for the purposes of DMA (or
swiotlb) etc.

That probably doesn't make as much sense on ARM (or HVM/PVH x86 for that
matter)

> It looks wrong to me, as mapping an MMIO region in the guest will allow
> him to use 1G mapping.
> 
> > This is fixed by
> > Arianna's "arch/arm: domain build: let dom0 access I/O memory of mapped
> > devices" (which initialises iomem_caps for dom0).
> 
> IIRC, this has been pushed a month ago on upstream.

So it has. Good.

Ian.