[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB5276CF6D8C18EB2F3BA779918C90A@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Thu, 15 May 2025 05:48:19 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>, "jgg@...dia.com" <jgg@...dia.com>,
"corbet@....net" <corbet@....net>, "will@...nel.org" <will@...nel.org>
CC: "bagasdotme@...il.com" <bagasdotme@...il.com>, "robin.murphy@....com"
<robin.murphy@....com>, "joro@...tes.org" <joro@...tes.org>,
"thierry.reding@...il.com" <thierry.reding@...il.com>, "vdumpa@...dia.com"
<vdumpa@...dia.com>, "jonathanh@...dia.com" <jonathanh@...dia.com>,
"shuah@...nel.org" <shuah@...nel.org>, "jsnitsel@...hat.com"
<jsnitsel@...hat.com>, "nathan@...nel.org" <nathan@...nel.org>,
"peterz@...radead.org" <peterz@...radead.org>, "Liu, Yi L"
<yi.l.liu@...el.com>, "mshavit@...gle.com" <mshavit@...gle.com>,
"praan@...gle.com" <praan@...gle.com>, "zhangzekun11@...wei.com"
<zhangzekun11@...wei.com>, "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-tegra@...r.kernel.org"
<linux-tegra@...r.kernel.org>, "linux-kselftest@...r.kernel.org"
<linux-kselftest@...r.kernel.org>, "patches@...ts.linux.dev"
<patches@...ts.linux.dev>, "mochs@...dia.com" <mochs@...dia.com>,
"alok.a.tiwari@...cle.com" <alok.a.tiwari@...cle.com>, "vasant.hegde@....com"
<vasant.hegde@....com>
Subject: RE: [PATCH v4 05/23] iommufd/driver: Let iommufd_viommu_alloc helper
save ictx to viommu->ictx
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Friday, May 9, 2025 11:02 AM
>
> When an IOMMU driver calls iommufd_viommu_alloc(), it must pass in an
> ictx
> pointer as the underlying _iommufd_object_alloc() helper function requires
> that to allocate a new object. However, neither the iommufd_viommu_alloc()
> nor its underlying _iommufd_object_alloc() saves the ictx in the allocated
> viommu object, although viommu could hold an ictx pointer.
>
> When the IOMMU driver wants to use another iommufd function passing in
> the
> allocated viommu, it could have avoided passing in the ictx pointer again,
> if viommu->ictx is valid.
>
> Save ictx to viommu->ictx in the iommufd_viommu_alloc(), in order to ease
> a new vIOMMU-based helper that would then get the ictx from viommu->ictx.
>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
Reviewed-by: Kevin Tian <kevin.tian@...el.com>
Powered by blists - more mailing lists