xen/arm64: head: Use a page mapping for the 1:1 mapping in create_page_tables()
authorJulien Grall <julien.grall@arm.com>
Thu, 27 Jun 2019 14:08:28 +0000 (15:08 +0100)
committerJulien Grall <julien.grall@arm.com>
Thu, 26 Sep 2019 15:03:39 +0000 (16:03 +0100)
commite14d26424bc1fb90913d830b4f8c6b4afc7c8c1b
treeb67b6429ccf6d311d78a77bb05b8e2cd8cb2f5fc
parent93dc90db0426debc7a88231e961aef2f8daf4bfc
xen/arm64: head: Use a page mapping for the 1:1 mapping in create_page_tables()

At the moment the function create_page_tables() will use 1GB/2MB
mapping for the identity mapping. As we don't know what is present
before and after Xen in memory, we may end up to map
device/reserved-memory with cacheable memory. This may result to
mismatched attributes as other users may access the same region
differently.

To prevent any issues, we should only map the strict minimum in the
1:1 mapping. A check in xen.lds.S already guarantees anything
necessary for turning on the MMU fits in a page (at the moment 4K).

As only one page will be mapped for the 1:1 mapping, it is necessary
to pre-allocate a page for the 3rd level table.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm64/head.S
xen/arch/arm/mm.c