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

Re: [Xen-devel] [PATCH for-4.13 v2] xen/arm: domain_build: Don't expose IOMMU specific properties to hwdom




On 10.10.19 18:32, Julien Grall wrote:
Hi,

Hi



[1] https://lists.xenproject.org/archives/html/xen-devel/2019-10/msg00104.html
---
  xen/arch/arm/domain_build.c | 29 +++++++++++++++++++++++++++++
  1 file changed, 29 insertions(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 6d6dd52..a7321b8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -480,10 +480,26 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo,
      const struct dt_property *prop, *status = NULL;
      int res = 0;
      int had_dom0_bootargs = 0;
+    struct dt_device_node *iommu_node;
        if ( kinfo->cmdline && kinfo->cmdline[0] )
          bootargs = &kinfo->cmdline[0];
  +    /*
+     * If we skip the IOMMU device when creating DT for hwdom (even if +     * the IOMMU device is not used by Xen), we should also skip the IOMMU +     * specific properties of the master device behind it in order to avoid
+     * exposing an half complete IOMMU bindings to hwdom.
+     * Use "iommu_node" as an indicator of the master device which properties
+     * should be skipped.
+     */
+    iommu_node = dt_parse_phandle(node, "iommus", 0);

The code is slightly confusing to read. I don't think we should care of invalid DT here, so let's only consider valid one.

Do you mean "the comment" is confusing to read?

The code is confusing because "iommus" should always point to a IOMMU node, but then you check whether this is an IOMMU. So it is not clear if this is done for sanity check (or for a different reason).

Got it. Will clarify a reason.


--
Regards,

Oleksandr Tyshchenko


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.