All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: xen-devel@lists.xen.org
Cc: "Viresh Kumar" <viresh.kumar@linaro.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Stefano Stabellini" <stefano.stabellini@xilinx.com>,
	"Mathieu Poirier" <mathieu.poirier@linaro.com>,
	"Oleksandr Tyshchenko" <olekstysh@gmail.com>,
	"Wei Liu" <wl@xen.org>, "Juergen Gross" <jgross@suse.com>,
	"Julien Grall" <julien@xen.org>,
	"Anthony PERARD" <anthony.perard@citrix.com>
Subject: [PATCH V6 3/3] libxl: arm: make creation of iommu node independent of disk device
Date: Thu,  8 Sep 2022 14:23:01 +0530	[thread overview]
Message-ID: <099616e1092409fceea4eb30590215310f8c091c.1662626550.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1662626550.git.viresh.kumar@linaro.org>

The iommu node will be required for other virtio device types too, not
just disk device.

Move the call to make_xen_iommu_node(), out of the disk device specific
block and rename "iommu_created" variable to "iommu_needed", and set it
to true for virtio disk device.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 tools/libs/light/libxl_arm.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index 55aee15c10b4..2637acafa358 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -1157,7 +1157,7 @@ static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_config *d_config,
     size_t fdt_size = 0;
     int pfdt_size = 0;
     libxl_domain_build_info *const info = &d_config->b_info;
-    bool iommu_created;
+    bool iommu_needed;
     unsigned int i;
 
     const libxl_version_info *vers;
@@ -1265,22 +1265,26 @@ static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_config *d_config,
         if (d_config->num_pcidevs)
             FDT( make_vpci_node(gc, fdt, ainfo, dom) );
 
-        iommu_created = false;
+        iommu_needed = false;
         for (i = 0; i < d_config->num_disks; i++) {
             libxl_device_disk *disk = &d_config->disks[i];
 
             if (disk->specification == LIBXL_DISK_SPECIFICATION_VIRTIO) {
-                if (disk->backend_domid != LIBXL_TOOLSTACK_DOMID &&
-                    !iommu_created) {
-                    FDT( make_xen_iommu_node(gc, fdt) );
-                    iommu_created = true;
-                }
+                if (disk->backend_domid != LIBXL_TOOLSTACK_DOMID)
+                    iommu_needed = true;
 
                 FDT( make_virtio_mmio_node(gc, fdt, disk->base, disk->irq,
                                            disk->backend_domid) );
             }
         }
 
+        /*
+         * Note, this should be only called after creating all virtio-mmio
+         * device nodes
+         */
+        if (iommu_needed)
+            FDT( make_xen_iommu_node(gc, fdt) );
+
         if (pfdt)
             FDT( copy_partial_fdt(gc, fdt, pfdt) );
 
-- 
2.31.1.272.g89b43f80a514



  parent reply	other threads:[~2022-09-08  8:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  8:52 [PATCH V6 0/3] libxl: arm: Make generic code independent of disk device Viresh Kumar
2022-09-08  8:52 ` [PATCH V6 1/3] libxl: arm: Create alloc_virtio_mmio_params() Viresh Kumar
2022-09-09 13:19   ` Anthony PERARD
2022-09-08  8:53 ` [PATCH V6 2/3] libxl: arm: Split make_virtio_mmio_node() Viresh Kumar
2022-09-09 13:21   ` Anthony PERARD
2022-09-08  8:53 ` Viresh Kumar [this message]
2022-09-09 13:47   ` [PATCH V6 3/3] libxl: arm: make creation of iommu node independent of disk device Anthony PERARD
2022-09-09 14:43   ` [PATCH V6.1 " Viresh Kumar
2022-09-09 15:02     ` Anthony PERARD
2022-09-20 10:29       ` Viresh Kumar
2022-10-04  9:59         ` Julien Grall
2022-11-24 19:19           ` Julien Grall
2022-11-25  5:45             ` Viresh Kumar
2022-11-28  9:31               ` Julien Grall
2022-09-16 10:21     ` Oleksandr

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=099616e1092409fceea4eb30590215310f8c091c.1662626550.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=mathieu.poirier@linaro.com \
    --cc=olekstysh@gmail.com \
    --cc=stefano.stabellini@xilinx.com \
    --cc=stratos-dev@op-lists.linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xen.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.