[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ztnx0c4BpGt6umrM@nvidia.com>
Date: Thu, 5 Sep 2024 11:00:49 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: <kevin.tian@...el.com>, <will@...nel.org>, <joro@...tes.org>,
<suravee.suthikulpanit@....com>, <robin.murphy@....com>,
<dwmw2@...radead.org>, <baolu.lu@...ux.intel.com>, <shuah@...nel.org>,
<linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kselftest@...r.kernel.org>,
<eric.auger@...hat.com>, <jean-philippe@...aro.org>, <mdf@...nel.org>,
<mshavit@...gle.com>, <shameerali.kolothum.thodi@...wei.com>,
<smostafa@...gle.com>, <yi.l.liu@...el.com>
Subject: Re: [PATCH v2 17/19] iommu/arm-smmu-v3: Add
arm_smmu_viommu_cache_invalidate
On Thu, Sep 05, 2024 at 01:20:39PM -0300, Jason Gunthorpe wrote:
> On Tue, Aug 27, 2024 at 09:59:54AM -0700, Nicolin Chen wrote:
>
> > +static int arm_smmu_viommu_cache_invalidate(struct iommufd_viommu *viommu,
> > + struct iommu_user_data_array *array)
> > +{
> > + struct iommu_domain *domain = iommufd_viommu_to_parent_domain(viommu);
> > +
> > + return __arm_smmu_cache_invalidate_user(
> > + to_smmu_domain(domain), viommu, array);
>
> I'd like to have the viommu struct directly hold the VMID. The nested
> parent should be sharable between multiple viommus, it doesn't make
> any sense that it would hold the vmid.
>
> This is struggling because it is trying too hard to not have the
> driver allocate the viommu, and I think we should just go ahead and do
> that. Store the vmid, today copied from the nesting parent in the vmid
> private struct. No need for iommufd_viommu_to_parent_domain(), just
> rework the APIs to pass the vmid down not a domain.
OK. When I designed all this stuff, we still haven't made mind
about sharing the s2 domain, i.e. moving the VMID, which might
need a couple of more patches to achieve.
I will try making some change for that.
Thanks
Nicolin
Powered by blists - more mailing lists