[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC 0/4] Add mem_access support for PV domains



This patch series adds mem_access support for PV domains. To do this the PV
domain domain has to be run with shadow paging. A new shadow mode, PG_mem_access
has been added for this. A p2m implementation for mem_access has also been
added to track the access permissions. Since special ring pages are not created
for PV domains, a new libxc API has been added to do this. The mem_access
listener has to call this API before trying to enable mem_access. This page
is freed when mem_access is disabled or when the domain is destroyed. 

When mem_access is enabled for a PV domain, PG_mem_access shadow is turned on 
and
all the shadows are dropped. In the resulting pagefaults, the entries are 
created
with the default access permissions. On future pagefaults, if there is a 
violation,
a mem_event is sent to the mem_access listener who will then resolve it. 

To get the access permissions for individual pages, the p2m access look up table
is referenced. To set the access permission of individual pages, the new
permission is set in the lookup table and the shadow for the gmfn is dropped and
on the resulting fault, the new PTE entry will be created with the new 
permission.
It should be noted that a mem_access listener for a PV domain does not need to
convert all pages in the PV domain to the default permission during setup and
teardown as this is done implicitly when enabling and disabling mem_access.

Patches are based on top of commit 31ee95.

Signed-off-by: Aravindh Puthiyaparambil <aravindp@xxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Keir Fraser <keir@xxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

  x86/mm: Shadow and p2m changes for PV mem_access
  x86/mem_access: mem_access and mem_event changes to support PV domains
  tools/libxc: Add APIs to create and get the PV ring page
  tool/xen-access: Add support for PV domains

 tools/libxc/xc_mem_access.c         |  29 ++++
 tools/libxc/xenctrl.h               |  17 ++-
 tools/tests/xen-access/xen-access.c | 122 +++++++++------
 xen/arch/x86/domain.c               |  12 ++
 xen/arch/x86/mm/Makefile            |   2 +-
 xen/arch/x86/mm/mem_access.c        | 146 ++++++++++++++++--
 xen/arch/x86/mm/mem_event.c         |  77 ++++++++--
 xen/arch/x86/mm/p2m-ma.c            | 286 ++++++++++++++++++++++++++++++++++++
 xen/arch/x86/mm/p2m.c               |  19 ++-
 xen/arch/x86/mm/paging.c            |  16 ++
 xen/arch/x86/mm/shadow/common.c     |  63 +++++++-
 xen/arch/x86/mm/shadow/multi.c      | 104 ++++++++++++-
 xen/include/asm-x86/domain.h        |   3 +
 xen/include/asm-x86/mem_access.h    |   4 +
 xen/include/asm-x86/p2m.h           |  51 +++++++
 xen/include/asm-x86/paging.h        |   3 +
 xen/include/asm-x86/shadow.h        |  11 ++
 xen/include/public/domctl.h         |   4 +
 xen/include/public/memory.h         |   2 +
 19 files changed, 897 insertions(+), 74 deletions(-)
 create mode 100644 xen/arch/x86/mm/p2m-ma.c

-- 
1.9.1


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.