[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFZE+MhTOCvbkKbH@nvidia.com>
Date: Fri, 20 Jun 2025 22:36:56 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>, Pranjal Shrivastava <praan@...gle.com>
CC: <kevin.tian@...el.com>, <corbet@....net>, <will@...nel.org>,
<bagasdotme@...il.com>, <robin.murphy@....com>, <joro@...tes.org>,
<thierry.reding@...il.com>, <vdumpa@...dia.com>, <jonathanh@...dia.com>,
<shuah@...nel.org>, <jsnitsel@...hat.com>, <nathan@...nel.org>,
<peterz@...radead.org>, <yi.l.liu@...el.com>, <mshavit@...gle.com>,
<zhangzekun11@...wei.com>, <iommu@...ts.linux.dev>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-tegra@...r.kernel.org>,
<linux-kselftest@...r.kernel.org>, <patches@...ts.linux.dev>,
<mochs@...dia.com>, <alok.a.tiwari@...cle.com>, <vasant.hegde@....com>,
<dwmw2@...radead.org>, <baolu.lu@...ux.intel.com>
Subject: Re: [PATCH v6 20/25] iommu/arm-smmu-v3-iommufd: Add hw_info to
impl_ops
On Fri, Jun 20, 2025 at 03:32:19AM +0000, Pranjal Shrivastava wrote:
> 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.
Thanks
Nicolin
Powered by blists - more mailing lists