xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 00/11] Implement the XEN_DOMCTL_memory_mapping hypercall for ARM
@ 2014-04-21 13:44 Arianna Avanzini
  2014-04-21 13:44 ` [PATCH v6 01/11] arch, arm: domain build: let dom0 access I/O memory of mapped devices Arianna Avanzini
                   ` (10 more replies)
  0 siblings, 11 replies; 39+ messages in thread
From: Arianna Avanzini @ 2014-04-21 13:44 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian.Campbell, paolo.valente, keir, stefano.stabellini,
	Ian.Jackson, dario.faggioli, tim, julien.grall, etrudeau,
	JBeulich, avanzini.arianna, viktor.kleinik

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

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

end of thread, other threads:[~2014-05-01 17:29 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 13:44 [PATCH v6 00/11] Implement the XEN_DOMCTL_memory_mapping hypercall for ARM Arianna Avanzini
2014-04-21 13:44 ` [PATCH v6 01/11] arch, arm: domain build: let dom0 access I/O memory of mapped devices Arianna Avanzini
2014-04-29 12:37   ` Julien Grall
2014-04-29 13:44     ` Julien Grall
2014-04-29 23:12       ` Arianna Avanzini
2014-04-21 13:44 ` [PATCH v6 02/11] arch, arm: add consistency check to REMOVE p2m changes Arianna Avanzini
2014-04-22 19:35   ` Julien Grall
2014-04-21 13:44 ` [PATCH v6 03/11] arch, arm: let map_mmio_regions() take pfn as parameters Arianna Avanzini
2014-04-28 13:13   ` Ian Campbell
2014-04-21 13:44 ` [PATCH v6 04/11] arch, arm: make pfn range passed to map_mmio_regions() inclusive Arianna Avanzini
2014-04-22 19:52   ` Julien Grall
2014-04-28 13:15     ` Ian Campbell
2014-04-21 13:44 ` [PATCH v6 05/11] arch, x86: check if mapping exists before memory_mapping removes it Arianna Avanzini
2014-04-22  8:34   ` Jan Beulich
2014-04-22  8:53     ` Julien Grall
2014-04-22  9:20       ` Jan Beulich
2014-04-21 13:44 ` [PATCH v6 06/11] xen, x86: factor out map and unmap from the memory_mapping DOMCTL Arianna Avanzini
2014-04-21 16:14   ` Andrew Cooper
2014-04-22  8:50     ` Jan Beulich
2014-04-22  8:48   ` Jan Beulich
2014-04-21 13:45 ` [PATCH v6 07/11] xen, common: move the memory_mapping DOMCTL hypercall to common code Arianna Avanzini
2014-04-22  8:55   ` Jan Beulich
2014-04-21 13:45 ` [PATCH v6 08/11] tools, libxl: parse optional start gfn from the iomem config option Arianna Avanzini
2014-04-22 19:57   ` Julien Grall
2014-04-28 13:20   ` Ian Campbell
2014-05-01 17:29     ` Julien Grall
2014-04-21 13:45 ` [PATCH v6 09/11] tools, libxl: add helpers to establish if guest is auto-translated Arianna Avanzini
2014-04-28 13:22   ` Ian Campbell
2014-04-21 13:45 ` [PATCH v6 10/11] tools, libxl: handle the iomem parameter with the memory_mapping hcall Arianna Avanzini
2014-04-22 20:03   ` Julien Grall
2014-04-28 13:25     ` Ian Campbell
2014-04-28 13:32       ` Julien Grall
2014-04-28 13:24   ` Ian Campbell
2014-04-21 13:45 ` [PATCH v6 11/11] xen, common: do not implicitly permit access to mapped I/O memory Arianna Avanzini
2014-04-22  9:12   ` Jan Beulich
2014-04-28 13:33     ` Ian Campbell
2014-04-28 13:54       ` Jan Beulich
2014-04-28 14:20         ` Ian Campbell
2014-04-28 13:28   ` Ian Campbell

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