xen/arm: mm: Use {, un}map_domain_page() to map/unmap Xen page-tables
authorJulien Grall <julien.grall@arm.com>
Thu, 4 Apr 2019 18:19:13 +0000 (19:19 +0100)
committerJulien Grall <julien.grall@arm.com>
Sun, 16 Jun 2019 20:24:45 +0000 (21:24 +0100)
commit771bb0dab0faf90705d738aacfd4cb2786bd3ad2
treee429cd2d416520cd1b9a9545b5f1fd83ef7924cc
parent18b7e30529e48789bbb52220553421cbab50bf27
xen/arm: mm: Use {, un}map_domain_page() to map/unmap Xen page-tables

Currently, the virtual address of the 3rd level page-tables is obtained
using mfn_to_virt().

On Arm32, mfn_to_virt can only work on xenheap page. While in theory
all the page-tables updated will reside in xenheap, in practice the
page-tables covering Xen memory (e.g xen_mapping) is part of Xen binary.

Furthermore, a follow-up change will update xen_pt_update_entry() to
walk all the levels and therefore be more generic. Some of the
page-tables will also part of Xen memory and therefore will not be
reachable using mfn_to_virt().

The easiest way to reach those pages is to use {, un}map_domain_page().
While on arm32 this means an extra mapping in the normal cases, this is not
very important as xen page-tables are not updated often.

In order to allow future change in the way Xen page-tables are mapped,
two new helpers are introduced to map/unmap the page-tables.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/mm.c