From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [RFC 00/19] xe/arm: Add support for non-pci passthrough Date: Mon, 16 Jun 2014 17:17:47 +0100 Message-ID: <1402935486-29136-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwZbs-0006gw-0r for xen-devel@lists.xenproject.org; Mon, 16 Jun 2014 16:18:16 +0000 Received: by mail-wg0-f45.google.com with SMTP id l18so5785764wgh.4 for ; Mon, 16 Jun 2014 09:18:14 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Hello all, This is the first attempt to add support for device tree passthrough (i.e non-pci 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 be 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. This has been tested on midway by assigning the secondary network to a guest. As this is an early stage of device passthrough, DOM0 has not been modified. Therefore to avoid DOM0 using the network card, a properties status="disabled" has been added in the device tree. I can send my device tree if necessary. TODO list: - Deassign device from dom0 before passthrough - Specific device properties in the DT There is also some TODO in different patches (see the /* TODO: */). The series is based on stefano's interrupts 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-v1 Sincerely yours, [1] http://lists.xen.org/archives/html/xen-devel/2014-06/msg01224.html [2] http://lists.xenproject.org/archives/html/xen-devel/2014-05/msg03050.html Julien Grall (19): xen/arm: guest_physmap_remove_page: Print a warning if we fail to unmap the page xen: guestcopy: Provide an helper to copy string from guest xen/arm: follow-up to allow DOM0 manage IRQ and MMIO xen/arm: route_irq_to_guest: Check validity of the IRQ xen/arm: Release IRQ routed to a domain when it's destroying xen/arm: Implement hypercall PHYSDEVOP_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_buildup 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/arm: Introduce DT_IRQ_TYPE_* libxl/arm: Rename set_interrupt_ppi to set_interrupt and handle SPIs libxl: Add support for non-PCI passthrough xl: Add new option dtdev docs/man/xl.cfg.pod.5 | 5 ++ tools/libxc/xc_domain.c | 29 ++++++ tools/libxc/xc_physdev.c | 129 ++++++++++++++++++++++++++ tools/libxc/xenctrl.h | 40 +++++++++ tools/libxl/Makefile | 2 +- tools/libxl/libxl_arch.h | 4 +- tools/libxl/libxl_arm.c | 142 +++++++++++++++++++++++++++-- tools/libxl/libxl_create.c | 11 +++ tools/libxl/libxl_dom.c | 22 ++++- tools/libxl/libxl_dtdev.c | 159 +++++++++++++++++++++++++++++++++ tools/libxl/libxl_internal.h | 31 +++++++ tools/libxl/libxl_types.idl | 5 ++ tools/libxl/libxl_x86.c | 4 +- tools/libxl/xl_cmdimpl.c | 21 ++++- xen/arch/arm/domain_build.c | 66 +++++++++----- xen/arch/arm/gic.c | 12 +++ xen/arch/arm/irq.c | 40 ++++++++- xen/arch/arm/p2m.c | 14 ++- xen/arch/arm/physdev.c | 93 ++++++++++++++++++- xen/arch/arm/vgic.c | 15 +++- xen/arch/x86/domctl.c | 2 +- xen/common/Makefile | 1 + xen/common/device_tree.c | 141 +++++++++++++++++++++++++++-- xen/common/domctl.c | 4 + xen/common/guestcopy.c | 28 ++++++ 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/gic.h | 5 ++ xen/include/asm-arm/irq.h | 6 ++ xen/include/public/arch-arm.h | 4 + xen/include/public/domctl.h | 10 +++ xen/include/public/physdev.h | 40 +++++++++ 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 +----- 39 files changed, 1166 insertions(+), 106 deletions(-) create mode 100644 tools/libxl/libxl_dtdev.c create mode 100644 xen/common/guestcopy.c -- 1.7.10.4