All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 p2 00/19] xen/arm Add support for non-PCI passthrough
@ 2015-04-09 15:09 Julien Grall
  2015-04-09 15:09 ` [PATCH v5 p2 01/19] xen/arm: Let the toolstack configure the number of SPIs Julien Grall
                   ` (18 more replies)
  0 siblings, 19 replies; 48+ messages in thread
From: Julien Grall @ 2015-04-09 15:09 UTC (permalink / raw)
  To: xen-devel
  Cc: ian.campbell, manish.jaggi, tim, robert.vanvossen, Julien Grall,
	stefano.stabellini, suravee.suthikulpanit, Josh.Whitehead,
	andrii.tseglytskyi

Hello all,

This is the fifth version of this patch series to add support for platform
device passthrough on ARM.

In order to passthrough a non-PCI device, the user will have to:
    - Map manually MMIO/IRQ
    - Describe the device in the newly partial device tree support
    - Specify the list of device protected by an IOMMU to assign to the
    guest.

While this solution is primitive, this is allow us to support more complex
device in Xen with an little additionnal work for the user. Attempting to
do it automatically is more difficult because we may not know the dependencies
between devices (for instance a Network card and a phy).

To avoid adding code in DOM0 to manage platform device deassignment, the
user has to add the property "xen,passthrough" to the device tree node
describing the device. This can be easily done via U-Boot. For instance,
if we want to passthrough the second network card of a Midway server to the
guest. The user will have to add the following line the u-boot script:

    fdt set /soc/ethernet@fff51000 xen,passthrough

This series has been tested on Midway by assigning the secondary network card
to a guest (see instruction below). Though, it requires a separate patch as
we decide to not support the Midway SMMU within the new drivers.

I plan to do futher testing on other boards.

A working tree can be found here:
    git://xenbits.xen.org/julieng/xen-unstable.git branch passthrough-v5.2

Major changes in v5:
    - Series divided in 2 parts. The first part [6] has been pushed to
    Xen upstream
    - Add more documentation
    - Modify XSM check for bind_pt_irq on ARM

Major changes in v4:
    - The partial device tree option can only be used with trusted
    device tree
    - Add more documentation
    - Use DOMCTL_bind_pt_irq rather than PHYSDEVOP_map_pirq
    - Add XSM support for non-PCI passthrough

Major changes in v3:
    - Rework the approach to passthrough a device (xen,passthrough +
      partial device tree).
    - Extend the existing hypercalls to assign/deassign device rather than
    adding new one.
    - Merge series [4] and [5] in this serie.

Major changes in v2:
     - Drop the patch #1 of the previous version
     - Virtual IRQ are not anymore equal to the physical interrupt
     - Move the hypercall to get DT informations for privcmd to domctl
     - Split the domain creation in 2 two parts to allow per guest
     VGIC configuration (such as the number of SPIs).
     - Bunch of typoes, commit improvement, function renaming.

For all changes see in each patch.

Sincerely yours,

[1] http://lists.xen.org/archives/html/xen-devel/2014-07/msg04090.html
[2] http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg01386.html
[3] http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg01612.html
[4] http://lists.xen.org/archives/html/xen-devel/2014-11/msg01672.html
[5] http://lists.xenproject.org/archives/html/xen-devel/2014-07/msg02098.html
[6] http://lists.xenproject.org/archives/html/xen-devel/2015-04/msg00248.html

Cc: manish.jaggi@caviumnetworks.com
Cc: suravee.suthikulpanit@amd.com
Cc: andrii.tseglytskyi@globallogic.com
Cc: robert.vanvossen@dornerworks.com
Cc: Josh.Whitehead@dornerworks.com

Julien Grall (19):
  xen/arm: Let the toolstack configure the number of SPIs
  xen/arm: vgic: Add spi_to_pending
  xen/arm: Release IRQ routed to a domain when it's destroying
  xen/arm: Implement hypercall DOMCTL_{,un}bind_pt_pirq
  xen: guestcopy: Provide an helper to safely copy string from guest
  xen/dts: Provide an helper to get a DT node from a path provided by a
    guest
  xen/passthrough: Introduce iommu_construct
  xen/passthrough: arm: release the DT devices assigned to a guest
    earlier
  xen/passthrough: iommu_deassign_device_dt: By default reassign device
    to nobody
  xen/iommu: arm: Wire iommu DOMCTL for ARM
  xen/xsm: Add helpers to check permission for device tree passthrough
  xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device
  tools/libxl: Create a per-arch function to map IRQ to a domain
  tools/libxl: Check if fdt_{first,next}_subnode are present in libfdt
  tools/(lib)xl: Add partial device tree support for ARM
  tools/libxl: arm: Use an higher value for the GIC phandle
  libxl: Add support for Device Tree passthrough
  xl: Add new option dtdev
  docs/misc: arm: Add documentation about Device Tree passthrough

 docs/man/xl.cfg.pod.5                 |  15 +++
 docs/misc/arm/passthrough.txt         |  61 +++++++++++
 tools/config.h.in                     |   6 ++
 tools/configure.ac                    |   5 +
 tools/libxc/include/xenctrl.h         |  18 ++++
 tools/libxc/xc_domain.c               | 170 +++++++++++++++++++++++++++---
 tools/libxl/Makefile                  |   2 +-
 tools/libxl/libxl.h                   |   6 ++
 tools/libxl/libxl_arch.h              |   4 +
 tools/libxl/libxl_arm.c               | 192 +++++++++++++++++++++++++++++++++-
 tools/libxl/libxl_create.c            |  38 ++++++-
 tools/libxl/libxl_internal.h          |   5 +
 tools/libxl/libxl_libfdt_compat.c     |  92 ++++++++++++++++
 tools/libxl/libxl_types.idl           |   9 ++
 tools/libxl/libxl_x86.c               |  13 +++
 tools/libxl/xl_cmdimpl.c              |  23 +++-
 xen/arch/arm/domain.c                 |   6 +-
 xen/arch/arm/domctl.c                 |  88 +++++++++++++++-
 xen/arch/arm/gic.c                    |  45 ++++++++
 xen/arch/arm/irq.c                    |  46 ++++++++
 xen/arch/arm/setup.c                  |   1 +
 xen/arch/arm/vgic.c                   |  34 +++++-
 xen/common/Makefile                   |   1 +
 xen/common/device_tree.c              |  18 ++++
 xen/common/guestcopy.c                |  31 ++++++
 xen/drivers/passthrough/arm/iommu.c   |   7 +-
 xen/drivers/passthrough/arm/smmu.c    |   8 +-
 xen/drivers/passthrough/device_tree.c | 136 ++++++++++++++++++++++--
 xen/drivers/passthrough/iommu.c       |  33 +++++-
 xen/drivers/passthrough/pci.c         |  69 ++++++------
 xen/include/asm-arm/gic.h             |   4 +
 xen/include/asm-arm/irq.h             |   2 +
 xen/include/asm-arm/vgic.h            |   3 +-
 xen/include/public/arch-arm.h         |   2 +
 xen/include/public/domctl.h           |  28 ++++-
 xen/include/xen/device_tree.h         |  14 +++
 xen/include/xen/guest_access.h        |   5 +
 xen/include/xen/iommu.h               |   7 +-
 xen/include/xsm/dummy.h               |  47 ++++++---
 xen/include/xsm/xsm.h                 |  55 +++++++---
 xen/xsm/dummy.c                       |  10 +-
 xen/xsm/flask/avc.c                   |   3 +
 xen/xsm/flask/flask_op.c              |  49 +++------
 xen/xsm/flask/hooks.c                 | 139 +++++++++++++++++-------
 xen/xsm/flask/include/avc.h           |   2 +
 xen/xsm/flask/policy/access_vectors   |   2 +-
 46 files changed, 1373 insertions(+), 181 deletions(-)
 create mode 100644 docs/misc/arm/passthrough.txt
 create mode 100644 tools/libxl/libxl_libfdt_compat.c
 create mode 100644 xen/common/guestcopy.c

-- 
2.1.4

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

end of thread, other threads:[~2015-04-28 13:31 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 15:09 [PATCH v5 p2 00/19] xen/arm Add support for non-PCI passthrough Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 01/19] xen/arm: Let the toolstack configure the number of SPIs Julien Grall
2015-04-16 14:39   ` Ian Campbell
2015-04-16 15:10     ` Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 02/19] xen/arm: vgic: Add spi_to_pending Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 03/19] xen/arm: Release IRQ routed to a domain when it's destroying Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 04/19] xen/arm: Implement hypercall DOMCTL_{, un}bind_pt_pirq Julien Grall
2015-04-16 14:55   ` Ian Campbell
2015-04-16 15:20     ` Julien Grall
2015-04-16 15:40       ` Ian Campbell
2015-04-17  6:02         ` Julien Grall
2015-04-17  9:47           ` Ian Campbell
2015-04-17 23:05     ` Daniel De Graaf
2015-04-09 15:09 ` [PATCH v5 p2 05/19] xen: guestcopy: Provide an helper to safely copy string from guest Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 06/19] xen/dts: Provide an helper to get a DT node from a path provided by a guest Julien Grall
2015-04-16 14:57   ` Ian Campbell
2015-04-09 15:09 ` [PATCH v5 p2 07/19] xen/passthrough: Introduce iommu_construct Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 08/19] xen/passthrough: arm: release the DT devices assigned to a guest earlier Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 09/19] xen/passthrough: iommu_deassign_device_dt: By default reassign device to nobody Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 10/19] xen/iommu: arm: Wire iommu DOMCTL for ARM Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 11/19] xen/xsm: Add helpers to check permission for device tree passthrough Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 12/19] xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device Julien Grall
2015-04-16 15:11   ` Ian Campbell
2015-04-16 15:21     ` Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 13/19] tools/libxl: Create a per-arch function to map IRQ to a domain Julien Grall
2015-04-16 15:12   ` Ian Campbell
2015-04-16 15:26     ` Julien Grall
2015-04-16 15:42       ` Ian Campbell
2015-04-09 15:09 ` [PATCH v5 p2 14/19] tools/libxl: Check if fdt_{first, next}_subnode are present in libfdt Julien Grall
2015-04-16 15:13   ` Ian Campbell
2015-04-09 15:09 ` [PATCH v5 p2 15/19] tools/(lib)xl: Add partial device tree support for ARM Julien Grall
2015-04-09 16:13   ` Ian Jackson
2015-04-28 13:30     ` Julien Grall
2015-04-16 15:17   ` Ian Campbell
2015-04-09 15:09 ` [PATCH v5 p2 16/19] tools/libxl: arm: Use an higher value for the GIC phandle Julien Grall
2015-04-09 16:17   ` Ian Jackson
2015-04-09 16:33     ` Julien Grall
2015-04-09 16:52       ` Ian Jackson
2015-04-09 17:00         ` Julien Grall
2015-04-09 17:02           ` Julien Grall
2015-04-09 17:04           ` Ian Jackson
2015-04-13 12:07             ` Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 17/19] libxl: Add support for Device Tree passthrough Julien Grall
2015-04-09 16:14   ` Ian Jackson
2015-04-16 15:19   ` Ian Campbell
2015-04-09 15:09 ` [PATCH v5 p2 18/19] xl: Add new option dtdev Julien Grall
2015-04-09 15:09 ` [PATCH v5 p2 19/19] docs/misc: arm: Add documentation about Device Tree passthrough Julien Grall
2015-04-16 15:20   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.