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

[Xen-devel] [PATCH v7 00/10] Implement the XEN_DOMCTL_memory_mapping hypercall for ARM



Hello,

here is my seventh attempt at proposing an implementation of the memory_mapping
DOMCTL for the ARM architecture. This cover letter just lists the main changes
performed on the patchset, while a more detailed description can be found in the
commit descriptions and in the changelog of each patch; also, more about the
previous versions of the patchset and its origins can be found in the last
full cover letter ([1]).

The commit description of patch 0001 has been changed to highlight some
limitations of the implementation, which were pointed out by Julien Grall.
As far as I know, he already has in his passthru-related series a follow-up
patch which addresses such limitations.

Patch 0002 has been changed to address an issue pointed out by Julien Grall; the
check added to ARM-related code on the existence of a mapping to be removed now
silently ignores that the gfn is not mapped on removal.

When using paddr_to_pfn_aligned(), now patch 0003 does not compute an useless
decrement on the addresses to be converted to pfns, as suggested by
Ian Campbell.

Also, this patchset finally implements a change to the interface of the
{map|unmap}_mmio_regions() functions, allowing them to accept a description of
the address range to map as a "start_gfn, nr_mfns pair". The change is performed
in the 0004 patch of this series, which substitutes the previous one, that
instead changed the map_mmio_regions() function to accept a range inclusive of
the end_gfn.
This change was requested by Ian Campbell and Andrew Cooper. The latter also
asked that all relevant functions touched by this patchset and still relying on
a "start_gfn, end_gfn" pair given as parameter were adapted to use the
"start_gfn, nr_mfns" model, which is not prone to misinterpretations about the
range being inclusive or exclusive of the end gfn.
The 0004 patch in this series, however, still produces the minimum necessary
changes to the functions which are to be introduced by this patch and to the
already-existing function map_mmio_regions() for the ARM architecture. Also, Jan
Beulich pointed out that a "start, count" pair cannot fully describe the address
range.
I'm including the requested change in the patch series just to have feedback
(and hoping this is the correct way to ask for feedback), if you consider the
previous implementation to be more appropriate I can easily revert to it.

Patch 0005, which adds to x86-related code a check on the existence of a to-be-
removed mapping, now lets the check just emit a warning on failure instead of
returning an error, as per Jan Beulich's suggestion.

Patch 0006 and 0007 have been hopefully improved as regards typing and
correct use of memory handling functions, following Jan Beulich's comments.

Patch 0008 now uses LIBXL_INVALID_GFN when useful, as suggested by Ian Campbell;
the manpage now also mentions the iomem option defaulting to an 1:1 mapping
when no gfn parameter is given and that it is for auto-translated domains, as
requested by Ian Campbell and Julien Grall.

Patch 0009 now checks if a domain is auto-translated in xc_domain_memory_mapping
to avoid to expose this information to libxl, as indicated by Ian Campbell; the
commit introducing libxl helpers to this purpose has been therefore dropped.

Patch 0010, which attempts to separate operations performed by the hypercalls
iomem_permission and memory_mapping, has been changed to address some issues
pointed out by Jan Beulich. It now lets I/O ports and I/O memory be treated the
same way when allowing access to a domain. Also, now it is iomem_permission
that checks if the calling domain is allowed to access to-be-mapped memory
ranges. As suggested by Ian Campbell, finally, this patch changes the construct
used by libxl during the initialization of PCI devices to (hopefully) better
suit the new execution flow.

The code has again 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 (10):
  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: let map_mmio_regions() use start and count
  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: 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                | 18 ++++++---
 tools/libxc/xc_domain.c              | 12 ++++++
 tools/libxl/libxl.h                  | 10 +++++
 tools/libxl/libxl_create.c           | 34 ++++++++++++++++
 tools/libxl/libxl_internal.h         |  1 +
 tools/libxl/libxl_pci.c              | 26 +++++-------
 tools/libxl/libxl_types.idl          |  4 ++
 tools/libxl/xl_cmdimpl.c             | 17 ++++----
 xen/arch/arm/domain_build.c          | 18 +++++++--
 xen/arch/arm/gic.c                   | 15 +++----
 xen/arch/arm/p2m.c                   | 44 +++++++++++++++++----
 xen/arch/arm/platforms/exynos5.c     |  9 ++---
 xen/arch/arm/platforms/omap5.c       | 17 ++++----
 xen/arch/arm/platforms/xgene-storm.c |  4 +-
 xen/arch/x86/domctl.c                | 76 ------------------------------------
 xen/arch/x86/mm/p2m.c                | 53 +++++++++++++++++++++++--
 xen/common/domctl.c                  | 70 ++++++++++++++++++++++++++++++---
 xen/include/asm-arm/mm.h             |  2 +
 xen/include/asm-arm/p2m.h            | 11 +++---
 xen/include/asm-x86/p2m.h            |  3 +-
 xen/include/xen/p2m-common.h         | 16 ++++++++
 21 files changed, 306 insertions(+), 154 deletions(-)
 create mode 100644 xen/include/xen/p2m-common.h

-- 
1.9.2


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