>>> On 10.05.17 at 16:03, <olekst...@gmail.com> wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshche...@epam.com>
> 
> The presence of this flag lets us know that the guest
> has devices which will most likely be used for passthrough
> and as the result the use of IOMMU is expected for this domain.
> In that case we have to call iommu_construct(), actually
> what the real assign_device call usually does.
> 
> As iommu_domain_init() is called with use_iommu flag being forced
> to false for now, no functional change is intended for both ARM and x86.
> 
> Basically, this patch is needed for non-shared IOMMUs on ARM only
> since the non-shared IOMMUs on x86 are ok if iommu_construct() is called
> later. But, in order to be more generic and for possible future optimization
> make this change appliable for both platforms.

I continue to be unconvinced that this is wanted / needed, as I
continue to not see why shared vs unshared really matters here.
After all we have both modes working on x86 without this flag.

> @@ -142,7 +142,14 @@ int iommu_domain_init(struct domain *d)
>          return 0;
>  
>      hd->platform_ops = iommu_get_ops();
> -    return hd->platform_ops->init(d);
> +    ret = hd->platform_ops->init(d);
> +    if ( ret )
> +        return ret;
> +
> +    if ( use_iommu && !is_hardware_domain(d) )
> +        ret = iommu_construct(d);

You don't handle the -ERESTART you may (and likely will) get here
or in the caller.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to