xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active
@ 2017-07-18 12:24 Sergej Proskurin
  2017-07-18 12:24 ` [PATCH v7 01/14] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
                   ` (14 more replies)
  0 siblings, 15 replies; 31+ messages in thread
From: Sergej Proskurin @ 2017-07-18 12:24 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. In
this patch version we refine the definition of PAGE_SIZE_GRAN and
PAGE_MASK_GRAN. In particular, we use PAGE_SIZE_GRAN to define PAGE_MASK_GRAN
and thus avoid these defines to have a differing type. We also changed the
previously introduced macro BITS_PER_LONG_LONG to BITS_PER_LLONG. Further
changes comprise minor adjustments in comments and renaming of macros and
function parameters. Some additional changes comprising code readability and
correct type usage have been made and stated in the individual commits.

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

Cheers,
~Sergej

[0] https://github.com/sergej-proskurin/xen (branch arm-gpt-walk-v7)

Sergej Proskurin (14):
  arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines
  arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h
  arm/mem_access: Add defines supporting PTs with varying page sizes
  arm/lpae: Introduce lpae_is_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/guest_access: Move vgic_access_guest_memory to guest_access.h
  arm/guest_access: Rename vgic_access_guest_memory
  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          | 631 +++++++++++++++++++++++++++++++++++++
 xen/arch/arm/guestcopy.c           |  50 +++
 xen/arch/arm/mem_access.c          |  31 +-
 xen/arch/arm/vgic-v3-its.c         |  37 +--
 xen/arch/arm/vgic.c                |  49 ---
 xen/include/asm-arm/bitops.h       |   1 +
 xen/include/asm-arm/config.h       |   2 +
 xen/include/asm-arm/guest_access.h |   3 +
 xen/include/asm-arm/guest_walk.h   |  19 ++
 xen/include/asm-arm/lpae.h         |  66 ++++
 xen/include/asm-arm/page.h         |   1 +
 xen/include/asm-arm/processor.h    |  69 +++-
 xen/include/asm-arm/short-desc.h   | 130 ++++++++
 xen/include/asm-arm/vgic.h         |   3 -
 xen/include/asm-x86/config.h       |   2 +
 xen/include/xen/bitops.h           |   3 +
 xen/include/xen/iommu.h            |  15 +-
 xen/include/xen/page-defs.h        |  24 ++
 19 files changed, 1048 insertions(+), 89 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
 create mode 100644 xen/include/xen/page-defs.h

--
2.13.2


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

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

end of thread, other threads:[~2017-08-09  9:14 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 12:24 [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active Sergej Proskurin
2017-07-18 12:24 ` [PATCH v7 01/14] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
2017-07-18 12:24 ` [PATCH v7 02/14] arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h Sergej Proskurin
2017-07-18 12:24 ` [PATCH v7 03/14] arm/mem_access: Add defines supporting PTs with varying page sizes Sergej Proskurin
2017-07-18 12:24 ` [PATCH v7 04/14] arm/lpae: Introduce lpae_is_page helper Sergej Proskurin
2017-07-18 12:24 ` [PATCH v7 05/14] arm/mem_access: Add short-descriptor pte typedefs and macros Sergej Proskurin
2017-07-18 12:24 ` [PATCH v7 06/14] arm/mem_access: Introduce GV2M_EXEC permission Sergej Proskurin
2017-07-18 12:25 ` [PATCH v7 07/14] arm/mem_access: Introduce BIT_ULL bit operation Sergej Proskurin
2017-07-18 12:25 ` [PATCH v7 08/14] arm/mem_access: Introduce GENMASK_ULL " Sergej Proskurin
2017-07-18 12:25 ` [PATCH v7 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h Sergej Proskurin
2017-07-18 12:25 ` [PATCH v7 10/14] arm/guest_access: Rename vgic_access_guest_memory Sergej Proskurin
2017-07-18 12:25 ` [PATCH v7 11/14] arm/mem_access: Add software guest-page-table walk Sergej Proskurin
2017-07-18 12:25 ` [PATCH v7 12/14] arm/mem_access: Add long-descriptor based gpt Sergej Proskurin
2017-07-20 15:20   ` Julien Grall
2017-07-18 12:25 ` [PATCH v7 13/14] arm/mem_access: Add short-descriptor " Sergej Proskurin
2017-08-08 15:17   ` Sergej Proskurin
2017-08-08 15:18     ` Julien Grall
2017-08-08 15:28       ` Sergej Proskurin
2017-08-08 16:20         ` Andrew Cooper
2017-08-08 16:30           ` Sergej Proskurin
2017-08-09  8:18             ` Sergej Proskurin
2017-08-09  9:14               ` Andrew Cooper
2017-07-18 12:25 ` [PATCH v7 14/14] arm/mem_access: Walk the guest's pt in software Sergej Proskurin
2017-07-31 14:38 ` [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active Julien Grall
2017-08-04  9:15   ` Sergej Proskurin
2017-08-08 12:17     ` Sergej Proskurin
2017-08-08 12:33       ` Julien Grall
2017-08-08 13:24         ` Julien Grall
2017-08-08 14:47           ` Sergej Proskurin
2017-08-08 14:58             ` Andrew Cooper
2017-08-08 15:04               ` 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).