[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC PATCH v3 00/10] arm/mem_access: Walk guest page tables in SW if mem_access is active
Hi all, The function p2m_mem_access_check_and_get_page is called from the function get_page_from_gva if mem_access is active and the hardware-aided translation of the given guest virtual address (gva) into machine address fails. That is, if the stage-2 translation tables constrain access to the guests's page tables, hardware-assisted translation will fail. The idea of the function p2m_mem_access_check_and_get_page is thus to translate the given gva and check the requested access rights in software. However, as the current implementation of p2m_mem_access_check_and_get_page makes use of the hardware-aided gva to ipa translation, the translation might also fail because of reasons stated above and will become equally relevant for the altp2m implementation on ARM. As such, we provide a software guest translation table walk to address the above mentioned issue. We submit this patch series as an RFC to discuss the appropriate location for the code and further functionality required to fix the above concerns. The current version of the implementation supports translation of both the short-descriptor as well as the long-descriptor translation table format on ARMv7 and ARMv8 (AArch32/AArch64). This revised version incorporates the comments of the previous patch series and mainly adds additional data-structures and defines to simplify code readability. Also, this patch series exposes p2m_* macros to access certain PTE properties in a more readable way. Apart from that, please note that since the individual functions responsible for walking the guest page tables must support various details of both AArch32 and AArch64, a simplification of seemingly identical parts in the affected functions has not always been possible. The following patch series can be found on Github[0]. Cheers, ~Sergej [0] https://github.com/sergej-proskurin/xen (branch arm-gpt-walk-v3) Sergej Proskurin (10): arm/mem_access: Add (TCR_|TTBCR_)* defines arm/mem_access: Add defines holding the width of 32/64bit regs arm/mem_access: Add defines supporting PTs with varying page sizes arm/mem_access: Add short-descriptor pte typedefs arm/p2m: Make PTE helpers publicly available arm/mem_access: Introduce GV2M_EXEC permission arm/mem_access: Add software guest-page-table walk arm/mem_access: Add long-descriptor based gpt arm/mem_access: Add short-descriptor based gpt arm/mem_access: Walk the guest's pt in software xen/arch/arm/Makefile | 1 + xen/arch/arm/guest_walk.c | 646 +++++++++++++++++++++++++++++++++++++++ xen/arch/arm/mem_access.c | 21 +- xen/arch/arm/p2m.c | 23 -- xen/include/asm-arm/guest_walk.h | 44 +++ xen/include/asm-arm/p2m.h | 27 ++ xen/include/asm-arm/page.h | 150 +++++++++ xen/include/asm-arm/processor.h | 73 ++++- 8 files changed, 957 insertions(+), 28 deletions(-) create mode 100644 xen/arch/arm/guest_walk.c create mode 100644 xen/include/asm-arm/guest_walk.h -- 2.12.2 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |