xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sergej Proskurin <proskurin@sec.in.tum.de>
To: xen-devel@lists.xenproject.org
Cc: Sergej Proskurin <proskurin@sec.in.tum.de>
Subject: [PATCH v8 00/13] arm/mem_access: Walk guest page tables in SW if mem_access is active
Date: Wed,  9 Aug 2017 10:20:25 +0200	[thread overview]
Message-ID: <20170809082038.3236-1-proskurin@sec.in.tum.de> (raw)

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. These comprise a comment explicitly stating the fact and
position where we recursively rely on the p2m->lock. We also add casts
to fields of the struct short_desc_t in guest_walk_sd as to cope with
incorrect values due to the C type promotion.

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

Cheers,
~Sergej

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

Sergej Proskurin (13):
  arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines
  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          | 636 +++++++++++++++++++++++++++++++++++++
 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/p2m.h          |   8 +-
 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 +
 18 files changed, 1035 insertions(+), 76 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.3


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

             reply	other threads:[~2017-08-09  8:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  8:20 Sergej Proskurin [this message]
2017-08-09  8:20 ` [PATCH v8 01/13] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 02/13] arm/mem_access: Add defines supporting PTs with varying page sizes Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 03/13] arm/lpae: Introduce lpae_is_page helper Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 04/13] arm/mem_access: Add short-descriptor pte typedefs and macros Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 05/13] arm/mem_access: Introduce GV2M_EXEC permission Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 06/13] arm/mem_access: Introduce BIT_ULL bit operation Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 07/13] arm/mem_access: Introduce GENMASK_ULL " Sergej Proskurin
2017-08-15 18:08   ` Sergej Proskurin
2017-08-15 22:24   ` Stefano Stabellini
2017-08-09  8:20 ` [PATCH v8 08/13] arm/guest_access: Move vgic_access_guest_memory to guest_access.h Sergej Proskurin
2017-08-16  9:58   ` Sergej Proskurin
2017-08-16 10:11     ` Julien Grall
2017-08-16 12:35       ` Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 09/13] arm/guest_access: Rename vgic_access_guest_memory Sergej Proskurin
2017-08-14 17:29   ` Julien Grall
2017-08-09  8:20 ` [PATCH v8 10/13] arm/mem_access: Add software guest-page-table walk Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 11/13] arm/mem_access: Add long-descriptor based gpt Sergej Proskurin
2017-08-14 17:37   ` Julien Grall
2017-08-14 21:03     ` Sergej Proskurin
2017-08-15 10:13       ` Julien Grall
2017-08-15 18:03         ` Sergej Proskurin
2017-08-15 22:25         ` Stefano Stabellini
2017-08-15 22:28           ` Andrew Cooper
2017-08-16  8:53             ` Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 12/13] arm/mem_access: Add short-descriptor " Sergej Proskurin
2017-08-09  8:20 ` [PATCH v8 13/13] arm/mem_access: Walk the guest's pt in software Sergej Proskurin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809082038.3236-1-proskurin@sec.in.tum.de \
    --to=proskurin@sec.in.tum.de \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).