xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/12] arm/mem_access: Walk guest page tables in SW if mem_access is active
@ 2017-06-27 11:52 Sergej Proskurin
  2017-06-27 11:52 ` [PATCH v5 01/12] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
                   ` (11 more replies)
  0 siblings, 12 replies; 46+ messages in thread
From: Sergej Proskurin @ 2017-06-27 11:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Sergej Proskurin

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.

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 changes the introduced data-structures and defines to simplify code.
Also, this patch reuses existing code for accessing the guest's memory through
the function vgic_access_guest_memory. In this way, we outsource
safety-relevant checks associated with accessing the guest's memory to one
place and hence simplify potential modification of such.  Please note that this
patch series is based on the second part of Julien Grall's patch series in [1]:
"xen/arm: Move LPAE definition in a separate header".

The following patch series can be found on Github[0].

Cheers,
~Sergej

[0] https://github.com/sergej-proskurin/xen (branch arm-gpt-walk-v5)
[1] https://lists.xen.org/archives/html/xen-devel/2017-06/msg02095.html


Sergej Proskurin (12):
  arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines
  arm/mem_access: Move PAGE_SHIFT_* macros to lib.h
  arm/mem_access: Add defines supporting PTs with varying page sizes
  arm/lpae: Introduce lpae_page helper
  arm/mem_access: Add short-descriptor pte typedefs and macros
  arm/mem_access: Introduce GV2M_EXEC permission
  arm/mem_access: Introduce BIT_ULL bit operation
  arm/mem_access: Introduce GENMASK_ULL bit operation
  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        | 614 +++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/mem_access.c        |  31 +-
 xen/include/asm-arm/bitops.h     |   1 +
 xen/include/asm-arm/config.h     |   2 +
 xen/include/asm-arm/guest_walk.h |  19 ++
 xen/include/asm-arm/lpae.h       |  67 +++++
 xen/include/asm-arm/page.h       |   1 +
 xen/include/asm-arm/processor.h  |  69 ++++-
 xen/include/asm-arm/short-desc.h | 130 +++++++++
 xen/include/xen/bitops.h         |   2 +
 xen/include/xen/iommu.h          |   3 +-
 xen/include/xen/lib.h            |   4 +
 13 files changed, 937 insertions(+), 7 deletions(-)
 create mode 100644 xen/arch/arm/guest_walk.c
 create mode 100644 xen/include/asm-arm/guest_walk.h
 create mode 100644 xen/include/asm-arm/short-desc.h

--
2.13.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2017-07-06 11:21 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27 11:52 [PATCH v5 00/12] arm/mem_access: Walk guest page tables in SW if mem_access is active Sergej Proskurin
2017-06-27 11:52 ` [PATCH v5 01/12] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
2017-07-04 16:04   ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 02/12] arm/mem_access: Move PAGE_SHIFT_* macros to lib.h Sergej Proskurin
2017-06-27 12:04   ` Jan Beulich
2017-07-03  8:40     ` Sergej Proskurin
2017-07-03  9:03       ` Sergej Proskurin
2017-07-03  9:16         ` Jan Beulich
2017-07-03 13:07           ` Sergej Proskurin
2017-07-03 13:25             ` Jan Beulich
2017-07-03  9:13       ` Jan Beulich
2017-07-03 13:17         ` Sergej Proskurin
2017-07-03 13:27           ` Jan Beulich
2017-06-27 11:52 ` [PATCH v5 03/12] arm/mem_access: Add defines supporting PTs with varying page sizes Sergej Proskurin
2017-07-04 16:15   ` Julien Grall
2017-07-04 21:33     ` Sergej Proskurin
2017-07-05 11:41       ` Julien Grall
2017-07-05 11:48         ` Sergej Proskurin
2017-06-27 11:52 ` [PATCH v5 04/12] arm/lpae: Introduce lpae_page helper Sergej Proskurin
2017-07-04 16:23   ` Julien Grall
2017-07-05 13:11     ` Sergej Proskurin
2017-07-05 13:12       ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 05/12] arm/mem_access: Add short-descriptor pte typedefs and macros Sergej Proskurin
2017-07-04 16:25   ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 06/12] arm/mem_access: Introduce GV2M_EXEC permission Sergej Proskurin
2017-06-27 11:52 ` [PATCH v5 07/12] arm/mem_access: Introduce BIT_ULL bit operation Sergej Proskurin
2017-07-04 16:26   ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 08/12] arm/mem_access: Introduce GENMASK_ULL " Sergej Proskurin
2017-07-04 16:28   ` Julien Grall
2017-07-04 20:46     ` Sergej Proskurin
2017-07-04 21:44       ` Sergej Proskurin
2017-07-05 12:39         ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 09/12] arm/mem_access: Add software guest-page-table walk Sergej Proskurin
2017-07-04 16:58   ` Julien Grall
2017-07-04 20:25     ` Sergej Proskurin
2017-07-05 12:36       ` Julien Grall
2017-07-05 12:46         ` Sergej Proskurin
2017-06-27 11:52 ` [PATCH v5 10/12] arm/mem_access: Add long-descriptor based gpt Sergej Proskurin
2017-07-04 17:06   ` Julien Grall
2017-07-05 14:37     ` Sergej Proskurin
2017-07-05 14:47       ` Julien Grall
2017-07-06 11:18     ` Sergej Proskurin
2017-07-06 11:21       ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 11/12] arm/mem_access: Add short-descriptor " Sergej Proskurin
2017-07-05 13:35   ` Julien Grall
2017-06-27 11:52 ` [PATCH v5 12/12] arm/mem_access: Walk the guest's pt in software Sergej Proskurin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).