xen: arm: use superpages in p2m when pages are suitably aligned
authorIan Campbell <ian.campbell@citrix.com>
Wed, 9 Jul 2014 12:07:45 +0000 (13:07 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 10 Jul 2014 14:36:24 +0000 (15:36 +0100)
commit5df01f6e2653ba38b3c55ef137dfc83fb99fad70
treecfce0ad87ec034c2fc61843c9eb7524fed51dc60
parentea37fd21110b6fbcf9257f814076a243d3873cb7
xen: arm: use superpages in p2m when pages are suitably aligned

This creates superpage (1G and 2M) mappings in the p2m for both domU and dom0
when the guest and machine addresses are suitably aligned. This relies on the
domain builder to allocate suitably sized regions, this is trivially true for
1:1 mapped dom0's and was arranged for guests in a previous patch. A non-1:1
dom0's memory is not currently deliberately aligned.

Since ARM pagetables are (mostly) consistent at each level this is implemented
by refactoring the handling of a single level of pagetable into a common
function. The two inconsistencies are that there are no superpage mappings at
level zero and that level three entry mappings must set the table bit.

When inserting new mappings the code shatters superpage mappings as necessary,
but currently makes no attempt to coalesce anything again. In particular when
inserting a mapping which could be a superpage over an existing table mapping
we do not attempt to free that lower page table and instead descend into it.

Some p2m statistics are added to keep track of the number of each level of
mapping and the number of times we've had to shatter an existing mapping.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/domain.c
xen/arch/arm/p2m.c
xen/include/asm-arm/p2m.h