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

Re: [Xen-devel] [PATCH V4 7/8] iommu/arm: Introduce iommu_add_dt_device API




On 19.09.19 15:29, Julien Grall wrote:
Hi,

Hi, Julien



+
+int __init iommu_add_dt_device(struct dt_device_node *np)

Sorry to only realise it now. Would it make sense to have this function implemented in xen/passthrough/device_tree.c?

Not entirely sure. device_tree.c is a common code. The iommu_fwspec stuff (widely used in this function) is ARM code.

Some of the device_tree.c already contains Arm specific code (such as device.h).

DT has been only used by Arm so far, so it is sadly fairly tie to the architecture. But it should be easy to make it generic if needs be (such as for RISCv).

While iommu_fwspec is been implemented in Arm headers, this could potentially be made common. So I would still prefer this that function is moved in device_tree.c

Well, will move. Also I will remove __init as it can be called at runtime...


As for runtime:

The current implementation allows us to fail at early stage if something is wrong with the device which is behind an IOMMU (and needs to be protected). As we scan for all present devices, but not only for "passthrough". The "splitting" into handle_device() for hwdom and iommu_do_dt_domctl() for other guests will postpone an error recognition to the guest domain creation time. So, we would have non function system anyway. Wouldn't be better to fail early instead of continue and fail anyway?


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