Thread (77 messages) 77 messages, 5 authors, 2025-06-26

Re: [PATCH v6 20/25] iommu/arm-smmu-v3-iommufd: Add hw_info to impl_ops

From: Pranjal Shrivastava <praan@google.com>
Date: 2025-06-23 15:14:04
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, linux-tegra, lkml

On Fri, Jun 20, 2025 at 10:36:56PM -0700, Nicolin Chen wrote:
quoted hunk ↗ jump to hunk
On Fri, Jun 20, 2025 at 03:32:19AM +0000, Pranjal Shrivastava wrote:
quoted
My point is that in-case someone passed INTEL_VTD type, we would end up
calling impl_ops->hw_info and then the impl_ops->hw_info shall check for
the type to return -EOPNOTSUPP. Either we should clearly mention that
each impl_op implementing hw_info *must* add another type and check for
it
Let's add this:
@@ -721,6 +721,11 @@ struct arm_smmu_impl_ops {
        int (*init_structures)(struct arm_smmu_device *smmu);
        struct arm_smmu_cmdq *(*get_secondary_cmdq)(
                struct arm_smmu_device *smmu, struct arm_smmu_cmdq_ent *ent);
+       /*
+        * An implementation should define its own type other than the default
+        * IOMMU_HW_INFO_TYPE_ARM_SMMUV3. And it must validate the input @type
+        * to return its own structure.
+        */
        void *(*hw_info)(struct arm_smmu_device *smmu, u32 *length, u32 *type);
        const size_t vsmmu_size;
        const enum iommu_viommu_type vsmmu_type;
And I found that we could have another patch changing "u32 *type"
to "enum iommufd_hw_info_flags *type" to avoid some duplications
in the kdocs.
Yea, that sounds good. Thanks!
Thanks
Nicolin
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help