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

Re: [Xen-devel] [PATCH 2/2] xen/arm: domain_build: Don't expose IOMMU specific properties to the guest




On 08.10.19 00:02, Julien Grall wrote:
Hi,

Hi Julien


But, this is clearly what happen in current Xen setup if the driver is
not enabled. What I want to avoid is exposing an half complete
bindings to the guest (you don't know how it will behave).

So we either remove all the properties and node related to the IOMMUs
or nothing.
I think, I got it. Our target is *not* to add a way for Dom0 to use
IOMMU, but to be consistent in removing IOMMU node/master device
properties. Now, we remove the IOMMU node if Xen identifies it (the
IOMMU driver is present in Xen),
so looks like we have to remove master device properties only if this
master device is behind the IOMMU which node is removed. This, I hope,
will avoid exposing an half complete bindings to guest. Am I right?


[1]
https://lists.xenproject.org/archives/html/xen-devel/2019-08/msg00858.html


----------

If you happy with that logic I will craft a proper patch.
The logic looks alright to me. One comment below, I will look at the
rest once this is formally sent.

ok




diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 67021d9..6d45e55 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 Dom0 (even if
I would prefer if we use "hwdom" over "Dom0". They are both the same on
Arm, but this may change in the future (we may actually drop Dom0 ;)).

Already sent v2, please see:

https://lists.xenproject.org/archives/html/xen-devel/2019-10/msg00673.html

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