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

[Xen-devel] [PATCH v6 00/11] Implement the XEN_DOMCTL_memory_mapping hypercall for ARM



Hello,

I'm back with a sixth attempt at proposing an implementation of the
XEN_DOMCTL_memory_mapping hypercall for the ARM architecture. As Prof. Paolo
Valente suggested, I'm trying to shorten this cover letter a bit more with
respect to the previous ones, just to avoid wasting too much of your time.
I am therefore only briefly listing here the patches that were modified, while
a more detailed description of the changes can be found in the commit
descriptions and in the changelog of each patch; also, more about the previous
versions can be found in the last full cover letter ([1]).
Please do not hesitate to tell me whether you find this appropriate or you
prefer a full-length cover letter, I'll certainly adapt to the more convenient
format.

Some issues in patch 0002 ("arch, arm: add consistency check to REMOVE p2m
changes") have been hopefully fixed due to some suggestions from Julien Grall.

As Ian Campbell pointed out, patch 0003 ("arch, arm: let map_mmio_regions() take
pfn as parameters") performs a subtle change due to the introduction of a new
paddr_to_pfn_aligned() macro, which, in the map_device() function, let a 
different
address be used as end address for an I/O memory range to be mapped, due to
page-alignment of different values. This, as he indicated, seems not to change
the underlying apply_p2m_changes() function's behavior (although, before reading
the code more attently, I didn't think so, for which I am sorry).
However, he also pointed out that the ARM version of map_mmio_regions() seems to
be exclusive of the end pfn of the range, while the x86 version, which will be
factored out from the memory_mapping DOMCTL in one of the following commits, is
inclusive of the end pfn. This v6 patchset therefore adds a patch (0004) to
make the map_mmio_regions() function for ARM inclusive of the end pfn passed
as parameter.

Commit "xen, common: add the XEN_DOMCTL_memory_mapping hypercall" has been split
into two patches (0006 and 0007) according to a suggestion from Ian Campbell, 
who
thought that letting x86 switch to the new {map|unmap}_mmio_regions() interface
separately from moving the DOMCTL to common code would allow to see more clearly
which changes have been made to the code of the DOMCTL itself.
The code added by patches 0006 and 0007 has been also hopefully improved after
some suggestions from Jan Beulich and Ian Campbell.
Also, please note that, due to recent changes to the x86 DOMCTL, I added a
definition of the memory_type_changed() function for ARM. The definition added
with this patchset is empty, as I am trying to make the minimum necessary
changes needed to add the DOMCTL for ARM. Please do tell me if something else
would be more correct or appropriate.

Patch 0008 ("tools, libxl: parse optional start gfn from the iomem config 
option")
has been fixed with respect to issues pointed out from Ian Campbell.

Finally, patch 0011 has been added after some discussion between Ian Campbell,
Julien Grall, Jan Beulich, Daniel De Graaf and Stefano Stabellini. It lets the
memory_mapping DOMCTL only perform the mapping of an I/O memory range, while
access permission to said range is not granted implicitly. Before mapping the
range to the domain's address space, the hypercall performs the needed 
permission
checks. The commit also attempts to make sure that access permission is granted
to I/O memory areas related to passthru PCI/VGA devices specified in the 
domain's
configuration.

The code has been tested on a cubieboard2, with Linux v3.13 as a dom0 and ERIKA
Enterprise ([2]) as a domU.
Any feedback about this new version of the patchset is more than welcome.
Arianna

[1] http://lists.xen.org/archives/html/xen-devel/2014-03/msg01724.html
[2] http://erika.tuxfamily.org/drupal/

Arianna Avanzini (11):
  arch, arm: domain build: let dom0 access I/O memory of mapped devices
  arch, arm: add consistency check to REMOVE p2m changes
  arch, arm: let map_mmio_regions() take pfn as parameters
  arch, arm: make pfn range passed to map_mmio_regions() inclusive
  arch, x86: check if mapping exists before memory_mapping removes it
  xen, x86: factor out map and unmap from the memory_mapping DOMCTL
  xen, common: move the memory_mapping DOMCTL hypercall to common code
  tools, libxl: parse optional start gfn from the iomem config option
  tools, libxl: add helpers to establish if guest is auto-translated
  tools, libxl: handle the iomem parameter with the memory_mapping hcall
  xen, common: do not implicitly permit access to mapped I/O memory

 docs/man/xl.cfg.pod.5                | 15 +++++--
 tools/libxl/libxl.h                  | 10 +++++
 tools/libxl/libxl_arch.h             |  4 ++
 tools/libxl/libxl_arm.c              |  5 +++
 tools/libxl/libxl_create.c           | 36 +++++++++++++++++
 tools/libxl/libxl_internal.h         |  1 +
 tools/libxl/libxl_pci.c              | 24 ++++++++---
 tools/libxl/libxl_types.idl          |  7 +++-
 tools/libxl/libxl_x86.c              |  6 +++
 tools/libxl/xl_cmdimpl.c             | 19 ++++-----
 xen/arch/arm/domain_build.c          | 18 +++++++--
 xen/arch/arm/gic.c                   | 21 +++++-----
 xen/arch/arm/p2m.c                   | 51 ++++++++++++++++++++----
 xen/arch/arm/platforms/exynos5.c     | 12 +++---
 xen/arch/arm/platforms/omap5.c       | 21 +++++-----
 xen/arch/arm/platforms/xgene-storm.c |  4 +-
 xen/arch/x86/domctl.c                | 77 ------------------------------------
 xen/arch/x86/mm/p2m.c                | 58 +++++++++++++++++++++++++--
 xen/common/domctl.c                  | 53 +++++++++++++++++++++++++
 xen/include/asm-arm/mm.h             |  2 +
 xen/include/asm-arm/p2m.h            | 10 ++---
 xen/include/asm-x86/p2m.h            |  3 +-
 xen/include/xen/p2m-common.h         | 16 ++++++++
 23 files changed, 330 insertions(+), 143 deletions(-)
 create mode 100644 xen/include/xen/p2m-common.h

-- 
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®.