xen/arm32: head: Use a page mapping for the 1:1 mapping in create_page_tables()
authorJulien Grall <julien.grall@arm.com>
Mon, 12 Aug 2019 15:30:37 +0000 (16:30 +0100)
committerJulien Grall <julien.grall@arm.com>
Thu, 26 Sep 2019 15:03:39 +0000 (16:03 +0100)
commit62529f16c8a26365a653e4e6f4554e4ac69cdcd9
treeb3a0e6b85856780d9d49f126786430a753291bb8
parent23dfe48d101adde8f7c61ba03d9738a47b2dc50e
xen/arm32: 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/arm32/head.S
xen/arch/arm/mm.c