All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: xen-devel@lists.xenproject.org, tim@xen.org,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	stefano.stabellini@citrix.com, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v4 31/33] libxl: Add support for non-PCI passthrough
Date: Tue, 31 Mar 2015 12:49:20 +0100	[thread overview]
Message-ID: <1427802560.2115.102.camel@citrix.com> (raw)
In-Reply-To: <1426793399-6283-32-git-send-email-julien.grall@linaro.org>

On Thu, 2015-03-19 at 19:29 +0000, Julien Grall wrote:
> On ARM, every non-PCI device are described in the device tree. Each of
> them can be found via a path.
> 
> This patch introduces a very basic support, only the IOMMU will be set
> up correctly. The user will have to:
>     - Describe the device in the partial device tree
>     - Map manually MMIO/IRQ
> 
> This is a first approach, that will allow to have a basic non-PCI
> passthrough support in Xen. This could be improved later.
> 
> Furthermore add LIBXL_HAVE_DEVICETREE_PASSTHROUGH to indicate we
> support non-PCI passthrough and partial device tree (introduced by a
> previous patch).

Ah, you can ignore my comment on the previous patch then.

The comment with the #define might be an OK place for the
big-scary-warning I mentioned in the previous patch too?

> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> 
> ---
>     Changes in v4:
>         - Add LIBXL_HAVE_DEVICTREE_PASSTHROUGH to indicate we support
>         non-PCI passthrough. This is also used in order to indicate
>         partial device tree is supported
>         - Remove libxl_dtdev.c as it contains only a 2 lines functions
>         and call directly xc_* from libxl_create.c
>         - Introduce domcreate_attach_dtdev
> 
>     Changes in v3:
>         - Dynamic allocation has been dropped
>         - Rework the commit message in accordance with the previous
>         item
> 
>     Changes in v2:
>         - Get DT infos earlier
>         - Allocate/map IRQ in libxl__arch_domain_create rather than in
>         libxl__device_dt_add
>         - Use VIRQ rather than the PIRQ to construct the interrupts
>         properties of the device tree
>         - Correct cpumask in make_dtdev_node. We allow the interrupt to
>         be used on the 8 CPUs
>         - Fix LOGE when we map the MMIO region in the guest in
>         libxl__device_dt_add. The domain and the IRQ were inverted
>         - Calculate the number of SPIs to configure the VGIC
>         - xc_physdev_dtdev_* helpers has been renamed to xc_dtdev_*
>         - Rename libxl_device_dt to libxl_device_dtdev
> ---
>  tools/libxl/libxl.h          |  6 ++++++
>  tools/libxl/libxl_create.c   | 32 ++++++++++++++++++++++++++++++++
>  tools/libxl/libxl_internal.h |  5 +++++
>  tools/libxl/libxl_types.idl  |  5 +++++
>  4 files changed, 48 insertions(+)
> 
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 6bc75c5..baaf06b 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -179,6 +179,12 @@
>  #define LIBXL_HAVE_BUILDINFO_HVM_MMIO_HOLE_MEMKB 1
>  
>  /*
> + * libxl_domain_build_info has device_tree and libxl_device_dtdev
> + * exists. This mean non-PCI passthrough is supported for ARM

Rather than non-PCI I'd say device tree here, since I'm sure you aren't
supporting the new flargle-bus I've just invented...

> + *
> +#define LIBXL_HAVE_DEVICETREE_PASSTHROUGH 1
> +
> +/*
>   * libxl ABI compatibility
>   *
>   * The only guarantee which libxl makes regarding ABI compatibility
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 15b464e..39c828b 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -751,6 +751,8 @@ static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev *multidev,
>                                     int ret);
>  static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *aodevs,
>                                   int ret);
> +static void domcreate_attach_dtdev(libxl__egc *egc,
> +                                   libxl__domain_create_state *dcs);
>  
>  static void domcreate_console_available(libxl__egc *egc,
>                                          libxl__domain_create_state *dcs);
> @@ -1444,6 +1446,36 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
>          }
>      }
>  
> +    domcreate_attach_dtdev(egc, dcs);
> +    return;
> +
> +error_out:
> +    assert(ret);
> +    domcreate_complete(egc, dcs, ret);
> +}
> +
> +static void domcreate_attach_dtdev(libxl__egc *egc,
> +                                   libxl__domain_create_state *dcs)

I know it isn't strictly needed, but I think for consistency this
function should take a ret and check it + propagate it via
domcreate_complete on error, like the other ones in the call chain do.

Ian.

  reply	other threads:[~2015-03-31 11:49 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 19:29 [PATCH v4 00/33] xen/arm: Add support for non-PCI passthrough Julien Grall
2015-03-19 19:29 ` [PATCH v4 01/33] xen/arm: Divide GIC initialization in 2 parts Julien Grall
2015-03-31 11:44   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 02/33] xen/dts: Allow only IRQ translation that are mapped to main GIC Julien Grall
2015-03-19 19:29 ` [PATCH v4 03/33] xen/dts: Use unsigned int for MMIO and IRQ index Julien Grall
2015-03-19 19:29 ` [PATCH v4 04/33] xen/arm: vgic: Introduce a function to initialize pending_irq Julien Grall
2015-03-19 19:29 ` [PATCH v4 05/33] xen/arm: Map disabled device in DOM0 Julien Grall
2015-03-19 19:29 ` [PATCH v4 06/33] xen/arm: Introduce xen, passthrough property Julien Grall
2015-03-31 10:25   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 07/33] xen: guestcopy: Provide an helper to safely copy string from guest Julien Grall
2015-03-31 13:24   ` Andrew Cooper
2015-03-31 13:30     ` Julien Grall
2015-03-31 13:49       ` Andrew Cooper
2015-03-31 14:00         ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 08/33] MAINTAINERS: move drivers/passthrough/device_tree.c in "DEVICE TREE" Julien Grall
2015-03-31 10:26   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 09/33] xen: Extend DOMCTL createdomain to support arch configuration Julien Grall
2015-03-31 10:39   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 10/33] xen/arm: Allow virq != irq Julien Grall
2015-03-31 10:41   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 11/33] xen/arm: route_irq_to_guest: Check validity of the IRQ Julien Grall
2015-03-20 11:36   ` Stefano Stabellini
2015-03-31 10:43   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 12/33] xen/arm: gic: Add sanity checks gic_route_irq_to_guest Julien Grall
2015-03-31 10:44   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 13/33] xen/arm: gic_route_irq_to_guest: Honor the priority given in parameter Julien Grall
2015-03-20 11:51   ` Stefano Stabellini
2015-03-31 10:45   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 14/33] xen/arm: vgic: Correctly calculate GICD_TYPER.ITLinesNumber Julien Grall
2015-03-31 10:46   ` Ian Campbell
2015-03-31 11:28     ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 15/33] xen/arm: gic: GICv2 & GICv3 only supports 1020 physical interrupts Julien Grall
2015-03-31 10:47   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 16/33] xen/arm: Let the toolstack configure the number of SPIs Julien Grall
2015-03-31 10:54   ` Ian Campbell
2015-03-31 11:44     ` Julien Grall
2015-03-31 11:59       ` Ian Campbell
2015-03-31 12:07         ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 17/33] xen/arm: vgic: Add spi_to_pending Julien Grall
2015-03-31 10:55   ` Ian Campbell
2015-03-31 11:58     ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 18/33] xen/arm: Release IRQ routed to a domain when it's destroying Julien Grall
2015-03-31 10:58   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 19/33] xen/arm: Implement hypercall DOMCTL_{, un}bind_pt_pirq Julien Grall
2015-03-31 11:11   ` Ian Campbell
2015-03-31 12:23     ` Julien Grall
2015-03-31 12:31       ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 20/33] xen/dts: Provide an helper to get a DT node from a path provided by a guest Julien Grall
2015-03-31 11:12   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 21/33] xen/passthrough: Introduce iommu_construct Julien Grall
2015-03-20 10:53   ` Jan Beulich
2015-03-31 11:13   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 22/33] xen/passthrough: arm: release the DT devices assigned to a guest earlier Julien Grall
2015-03-31 11:16   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 23/33] xen/passthrough: iommu_deassign_device_dt: By default reassign device to nobody Julien Grall
2015-03-31 11:16   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 24/33] xen/iommu: arm: Wire iommu DOMCTL for ARM Julien Grall
2015-03-19 19:29 ` [PATCH v4 25/33] xen/xsm: Add helpers to check permission for device tree passthrough Julien Grall
2015-03-31 11:17   ` Ian Campbell
2015-03-31 17:12   ` Daniel De Graaf
2015-03-31 17:14     ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 26/33] xen/passthrough: Extend XEN_DOMCTL_*assign_device to support DT device Julien Grall
2015-03-20 11:01   ` Jan Beulich
2015-03-31 11:24   ` Ian Campbell
2015-03-31 12:30     ` Julien Grall
2015-03-31 13:16       ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 27/33] tools/libxl: Create a per-arch function to map IRQ to a domain Julien Grall
2015-03-31 11:26   ` Ian Campbell
2015-03-31 12:33     ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 28/33] tools/libxl: Check if fdt_{first, next}_subnode are present in libfdt Julien Grall
2015-03-19 19:42   ` Julien Grall
2015-03-31 11:35   ` Ian Campbell
2015-03-31 12:46     ` Julien Grall
2015-03-31 13:18       ` Ian Campbell
2015-04-07 17:15         ` Julien Grall
2015-04-09 12:16         ` Ian Jackson
2015-04-09 13:59           ` Julien Grall
2015-04-14 11:40           ` Ian Campbell
2015-04-14 13:34             ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 29/33] tools/(lib)xl: Add partial device tree support for ARM Julien Grall
2015-03-31 11:41   ` Ian Campbell
2015-03-31 12:55     ` Julien Grall
2015-03-31 13:19       ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 30/33] tools/libxl: arm: Use an higher value for the GIC phandle Julien Grall
2015-03-31 11:43   ` Ian Campbell
2015-04-09 12:36     ` Julien Grall
2015-03-19 19:29 ` [PATCH v4 31/33] libxl: Add support for non-PCI passthrough Julien Grall
2015-03-31 11:49   ` Ian Campbell [this message]
2015-03-31 13:00     ` Julien Grall
2015-03-31 13:20       ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 32/33] xl: Add new option dtdev Julien Grall
2015-03-31 11:50   ` Ian Campbell
2015-03-19 19:29 ` [PATCH v4 33/33] docs/misc: arm: Add documentation about non-PCI passthrough Julien Grall
2015-03-31 11:55   ` Ian Campbell
2015-03-31 13:03     ` Julien Grall
2015-03-31 13:21       ` Ian Campbell
2015-04-09 13:36         ` Julien Grall
2015-03-20  1:22 ` [PATCH v4 00/33] xen/arm: Add support for " Edgar E. Iglesias
2015-03-20 17:34   ` Julien Grall
2015-03-31 11:57 ` Ian Campbell
2015-03-31 13:07   ` Julien Grall
2015-03-31 13:22     ` Ian Campbell
2015-04-01 14:21       ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427802560.2115.102.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.