Message ID | 1501003615-15274-9-git-send-email-olekstysh@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Oleksandr, On 25/07/17 18:26, Oleksandr Tyshchenko wrote: > From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> > > 1. Add missing return in case if IOMMU ops have been already set. > 2. Add check for shared IOMMU before returning an error. Technically 1. is a fix, 2. is a new feature as sharing IOMMU is not supported today. I am ok for you to keep both in the same patch this time, but in the future please avoid mixing fixes and new feature. Reviewed-by: Julien Grall <julien.grall@arm.com> Cheers,
Hi, Julien On Thu, Aug 3, 2017 at 2:31 PM, Julien Grall <julien.grall@arm.com> wrote: > Hi Oleksandr, > > On 25/07/17 18:26, Oleksandr Tyshchenko wrote: >> >> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> >> >> 1. Add missing return in case if IOMMU ops have been already set. >> 2. Add check for shared IOMMU before returning an error. > > > Technically 1. is a fix, 2. is a new feature as sharing IOMMU is not > supported today. I am ok for you to keep both in the same patch this time, > but in the future please avoid mixing fixes and new feature. ok > > Reviewed-by: Julien Grall <julien.grall@arm.com> Thank you! > > Cheers, > > -- > Julien Grall
diff --git a/xen/drivers/passthrough/arm/iommu.c b/xen/drivers/passthrough/arm/iommu.c index 95b1abb..6f01c13 100644 --- a/xen/drivers/passthrough/arm/iommu.c +++ b/xen/drivers/passthrough/arm/iommu.c @@ -32,7 +32,10 @@ void __init iommu_set_ops(const struct iommu_ops *ops) BUG_ON(ops == NULL); if ( iommu_ops && iommu_ops != ops ) + { printk("WARNING: Cannot set IOMMU ops, already set to a different value\n"); + return; + } iommu_ops = ops; } @@ -70,6 +73,6 @@ void arch_iommu_domain_destroy(struct domain *d) int arch_iommu_populate_page_table(struct domain *d) { - /* The IOMMU shares the p2m with the CPU */ - return -ENOSYS; + /* Return an error if the IOMMU shares the p2m with the CPU */ + return iommu_use_hap_pt(d) ? -ENOSYS : 0; }