Hi Oleksandr,

On 8/20/19 7:09 PM, Oleksandr Tyshchenko wrote:
From: Oleksandr Tyshchenko <oleksandr_tyshche...@epam.com>

Introduce a separate file to keep various helpers which could be used
by more than one IOMMU driver in order not to duplicate code.

The first candidates to be moved to the new file are SMMU driver's
"map_page/unmap_page" callbacks. There callbacks neither contain any

s/There/These/ I think.

SMMU specific info nor perform any SMMU specific actions and are going
to be the same across all IOMMU drivers which H/W IP shares P2M
with the CPU like SMMU does.

So, move callbacks to iommu_helpers.c for the upcoming IPMMU driver
to be able to re-use them.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshche...@epam.com>
CC: Julien Grall <julien.gr...@arm.com>

[...]

  static __init const struct arm_smmu_device *find_smmu(const struct device 
*dev)
diff --git a/xen/include/asm-arm/iommu.h b/xen/include/asm-arm/iommu.h
index 904c9ae..20d865e 100644
--- a/xen/include/asm-arm/iommu.h
+++ b/xen/include/asm-arm/iommu.h
@@ -26,6 +26,13 @@ struct arch_iommu
  const struct iommu_ops *iommu_get_ops(void);
  void iommu_set_ops(const struct iommu_ops *ops);
+/* mapping helpers */

I would specify this only works when the PT is shared between the IOMMU and CPU.

With the two requests addressed:

Acked-by: Julien Grall <julien.gr...@arm.com>

+int __must_check arm_iommu_map_page(struct domain *d, dfn_t dfn, mfn_t mfn,
+                                    unsigned int flags,
+                                    unsigned int *flush_flags);
+int __must_check arm_iommu_unmap_page(struct domain *d, dfn_t dfn,
+                                      unsigned int *flush_flags);
+
  #endif /* __ARCH_ARM_IOMMU_H__ */
/*


Cheers,

--
Julien Grall

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

Reply via email to