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

[Xen-devel] [PATCH v2 00/21] xen/arm: Add support for non-pci passthrough



Hello all,

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

The user will have to specify the list of device node to passthrough via
the new options "dtdev" in the xl configuration file. Only device protected
by an IOMMU can be passthrough to the guest. This is because the device
can use DMA and will therefore use the wrong address space.
I'm thinking to add an option "force" when the user knows that this device
doesn't use DMA. This might be useful to passthrough serial device.

To avoid adding code in DOM0 to manage platform device deassignment, the
user has to mark the device disabled in the device tree. I can be easily
done via u-boot. For instance, if we want to passthrough the second network
card of the a midway node to the guest. The user will have add the following
line in the u-boot script:

fdt set /soc/ethernet@fff51000 status disabled

Restrictions of this series:
    - If the total amount of MMIO used by device passthrough for a
    single guest is greater than 768MB, the guest won't boot
    - It's not possible to deassign device used by DOM0. This is because
    of lack of reset/deassignment drivers.
    - Only common device properties (interrupts, regs) are written to
    the guest device tree. Device that needs other properties may not work.

I don't plan to handle those restrictions for this version as I don't think
they are important for a first step and the current series is still usable
with simple device. I also like to see this series upstream for Xen 4.5.

This series has been tested on midway by assigning the secondary network card
to a guest.

There is some TODO, mostly related to XSM in different patch (see commit message
or /* TODO: ... */ in the files).

This series is based on stefano's interrupt series [1] and Arianna's memory
mapping series [2]. A working tree can be found here:

git://xenbits.xen.org/people/julieng/xen-unstable.git branch passthrough-v2

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,

Arianna Avanzini (1):
  xen/common: do not implicitly permit access to mapped I/O memory

Julien Grall (20):
  xen: guestcopy: Provide an helper to safely copy string from guest
  xen/arm: vgic: Rename nr_lines into nr_spis
  xen/arm: vgic: Introduce a function to initialize pending_irq
  xen/arm: follow-up to allow DOM0 manage IRQ and MMIO
  xen/arm: Allow virq != irq
  xen/arm: route_irq_to_guest: Check validity of the IRQ
  xen/arm: Initialize the virtual GIC later
  xen/arm: Release IRQ routed to a domain when it's destroying
  xen/arm: Implement hypercall PHYSDEVOP_{,un}map_pirq
  xen/dts: Use unsigned int for MMIO and IRQ index
  xen/dts: Provide an helper to get a DT node from a path provided by a
    guest
  xen/dts: Add hypercalls to retrieve device node information
  xen/passthrough: Introduce iommu_construct
  xen/passthrough: Call arch_iommu_domain_destroy before calling
    iommu_teardown
  xen/passthrough: iommu_deassign_device_dt: By default reassign device
    to nobody
  xen/iommu: arm: Wire iommu DOMCTL for ARM
  xen/passthrough: dt: Add new domctl XEN_DOMCTL_assign_dt_device
  xen/arm: Reserve region in guest memory for device passthrough
  libxl: Add support for non-PCI passthrough
  xl: Add new option dtdev

 docs/man/xl.cfg.pod.5                 |    5 +
 tools/libxc/xc_domain.c               |  177 +++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h                 |   46 +++++++++
 tools/libxl/Makefile                  |    2 +-
 tools/libxl/libxl_arch.h              |    7 +-
 tools/libxl/libxl_arm.c               |  148 ++++++++++++++++++++++++++-
 tools/libxl/libxl_create.c            |   27 +++++
 tools/libxl/libxl_dom.c               |    9 +-
 tools/libxl/libxl_dtdev.c             |  153 ++++++++++++++++++++++++++++
 tools/libxl/libxl_internal.h          |   32 ++++++
 tools/libxl/libxl_types.idl           |    5 +
 tools/libxl/libxl_x86.c               |   11 +-
 tools/libxl/xl_cmdimpl.c              |   21 +++-
 xen/arch/arm/domain.c                 |   28 ++++--
 xen/arch/arm/domain_build.c           |   71 ++++++++-----
 xen/arch/arm/domctl.c                 |   22 +++-
 xen/arch/arm/gic-v2.c                 |    2 -
 xen/arch/arm/gic.c                    |   41 +++++++-
 xen/arch/arm/irq.c                    |  134 ++++++++++++++++++++++---
 xen/arch/arm/physdev.c                |  120 +++++++++++++++++++++-
 xen/arch/arm/setup.c                  |   10 +-
 xen/arch/arm/vgic-v2.c                |    2 +-
 xen/arch/arm/vgic.c                   |  105 +++++++++++++++----
 xen/common/Makefile                   |    1 +
 xen/common/device_tree.c              |  143 +++++++++++++++++++++++++-
 xen/common/domctl.c                   |   46 ++++-----
 xen/common/guestcopy.c                |   29 ++++++
 xen/drivers/passthrough/arm/iommu.c   |    6 ++
 xen/drivers/passthrough/arm/smmu.c    |    7 +-
 xen/drivers/passthrough/device_tree.c |   60 +++++++++--
 xen/drivers/passthrough/iommu.c       |   36 ++++++-
 xen/drivers/passthrough/pci.c         |   12 +--
 xen/include/asm-arm/domain.h          |    9 +-
 xen/include/asm-arm/gic.h             |    7 +-
 xen/include/asm-arm/irq.h             |    8 +-
 xen/include/asm-arm/vgic.h            |   13 ++-
 xen/include/public/arch-arm.h         |    4 +
 xen/include/public/domctl.h           |   64 ++++++++++++
 xen/include/xen/device_tree.h         |   27 ++++-
 xen/include/xen/guest_access.h        |    5 +
 xen/include/xen/iommu.h               |    5 +
 xen/xsm/flask/flask_op.c              |   29 +-----
 xen/xsm/flask/hooks.c                 |    3 +
 xen/xsm/flask/policy/access_vectors   |    2 +
 44 files changed, 1522 insertions(+), 172 deletions(-)
 create mode 100644 tools/libxl/libxl_dtdev.c
 create mode 100644 xen/common/guestcopy.c

-- 
1.7.10.4


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