xen/arm: p2m: Handle translation fault in get_page_from_gva
authorJulien Grall <julien.grall@arm.com>
Wed, 21 Feb 2018 14:18:40 +0000 (14:18 +0000)
committerJulien Grall <julien.grall@arm.com>
Wed, 12 Dec 2018 16:04:51 +0000 (16:04 +0000)
commit6d6be98ca52ca977fb3deb4d6f665bcfb84a8ec7
treee21d83ad957b2f081e5ba1b9b2df114eb377b84f
parent2a654d312914218782e4e3fc359ff20fe62f7b60
xen/arm: p2m: Handle translation fault in get_page_from_gva

A follow-up patch will re-purpose the valid bit of LPAE entries to
generate fault even on entry containing valid information.

This means that when translating a guest VA to guest PA (e.g IPA) will
fail if the Stage-2 entries used have the valid bit unset. Because of
that, we need to fallback to walk the page-table in software to check
whether the fault was expected.

This patch adds the software page-table walk on all the translation
fault. It would be possible in the future to avoid pointless walk when
the fault in PAR_EL1 is not a translation fault.

This function has only worked for guest RAM pages (no foreing mappings or
MMIO mappings) because we require the page to belong to the domain for
getting a reference. This means we can deny all non guest RAM pages.

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