[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHahEP0+LKmeA/Tf@Asurada-Nvidia>
Date: Tue, 15 Jul 2025 11:42:24 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Will Deacon <will@...nel.org>
CC: <jgg@...dia.com>, <kevin.tian@...el.com>, <corbet@....net>,
<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>,
<praan@...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 v9 23/29] iommu/arm-smmu-v3-iommufd: Add vsmmu_size/type
and vsmmu_init impl ops
Hi Will,
Sorry for the late response.
On Fri, Jul 11, 2025 at 05:14:27PM +0100, Will Deacon wrote:
> > /* MMIO registers */
> > #define ARM_SMMU_IDR0 0x0
> > @@ -720,6 +721,10 @@ 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);
> > + const size_t vsmmu_size;
> > + const enum iommu_viommu_type vsmmu_type;
> > + int (*vsmmu_init)(struct arm_vsmmu *vsmmu,
> > + const struct iommu_user_data *user_data);
>
> It would be nice to avoid adding data members to the ops structure, if
You mean the "vsmmu_size" and "vsmmu_type" right?
So you want them to be removed, by having two impl_ops:
size_t get_vsmmu_size(enum iommu_viommu_type vsmmu_type);
int (*vsmmu_init)(struct arm_vsmmu *vsmmu,
const struct iommu_user_data *user_data);
right?
> at all possible. The easiest thing would probably be to add a function
> for getting the vsmmu size and then pushing the two checks against
> 'vsmmu_type' down into the impl_ops callbacks so that:
>
> 1. If the type is IOMMU_VIOMMU_TYPE_ARM_SMMUV3, we don't bother with
> the impl_ops at all in arm_vsmmu_init() and arm_smmu_get_viommu_size()
Hmm, I was hoping for an implementation could support the default
IOMMU_VIOMMU_TYPE_ARM_SMMUV3 while having its own viommu_ops or so.
But I think your suggestion is fine since there is no such a use
case at this moment :)
> 2. Otherwise, we pass the type into the impl_ops and they can check it
>
> Of course, that can be a patch on top of the series as there's no point
> respinning the whole just for this.
Thanks for that! I can draft a patch to send later this week once
the requirements are confirmed.
Nicolin
Powered by blists - more mailing lists