xen/arm: mm: Set-up page permission for Xen mappings earlier on
authorJulien Grall <julien.grall@arm.com>
Thu, 29 Nov 2018 11:37:43 +0000 (11:37 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 12 Dec 2018 23:07:32 +0000 (15:07 -0800)
commit00c96d77422a4b84247bec5dadf434363d312cac
treeadc003b2f21c6fa43f6b345575dea84715c0f97d
parent9c35572f359cd6f71aa20b0991c74e032b8721d2
xen/arm: mm: Set-up page permission for Xen mappings earlier on

Xen mapping is first create using a 2MB page and then shatterred in 4KB
page for fine-graine permission. However, it is not safe to break-down
superpage page without going to an intermediate step invalidating
the entry.

As we are changing Xen mappings, we cannot go through the intermediate
step. The only solution is to create Xen mapping using 4KB entries
directly. As the Xen should always access the mappings according with
the runtime permission, it is then possible to set-up the permissions
while create the mapping.

We are still playing with the fire as there are still some
break-before-make issue in setup_pagetables (i.e switch between 2 sets of
page-tables). But it should slightly be better than the current state.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reported-by: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
Reported-by: Jan-Peter Larsson <Jan-Peter.Larsson@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Tested-by: Matthew Daley <mattd@bugfuzz.com>
xen/arch/arm/mm.c