arm/mem_access: Add software guest-page-table walk
authorSergej Proskurin <proskurin@sec.in.tum.de>
Wed, 16 Aug 2017 13:17:41 +0000 (15:17 +0200)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 18 Aug 2017 17:27:40 +0000 (10:27 -0700)
commit7e32eb7c7ca7b3bc788f982b53908727f698c9ac
tree1532633d59a3895ac007a2739f3dd7bff5158fab
parent379c22ad5036adee5ee7f3790fae748c87965419
arm/mem_access: Add software guest-page-table walk

The function p2m_mem_access_check_and_get_page in mem_access.c
translates a gva to an ipa by means of the hardware functionality of the
ARM architecture. This is implemented in the function gva_to_ipa. If
mem_access is active, hardware-based gva to ipa translation might fail,
as gva_to_ipa uses the guest's translation tables, access to which might
be restricted by the active VTTBR. To address this issue, in this commit
we add a software-based guest-page-table walk, which will be used by the
function p2m_mem_access_check_and_get_page perform the gva to ipa
translation in software in one of the following commits.

Note: The introduced function guest_walk_tables assumes that the domain,
the gva of which is to be translated, is running on the currently active
vCPU. To walk the guest's page tables on a different vCPU, the following
registers would need to be loaded: TCR_EL1, TTBR0_EL1, TTBR1_EL1, and
SCTLR_EL1.

Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de>
Acked-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/Makefile
xen/arch/arm/guest_walk.c [new file with mode: 0644]
xen/include/asm-arm/guest_walk.h [new file with mode: 0644]