[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aDnd0i4OViUZ9uIX@Asurada-Nvidia>
Date: Fri, 30 May 2025 09:33:22 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.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>,
<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 v5 13/29] iommufd/viommu: Introduce IOMMUFD_OBJ_HW_QUEUE
and its related struct
On Fri, May 30, 2025 at 01:07:53PM -0300, Jason Gunthorpe wrote:
> On Sat, May 17, 2025 at 08:21:30PM -0700, Nicolin Chen wrote:
> > struct iommufd_viommu_ops {
> > + u32 flags;
> > void (*destroy)(struct iommufd_viommu *viommu);
> > struct iommu_domain *(*alloc_domain_nested)(
> > struct iommufd_viommu *viommu, u32 flags,
> > @@ -171,6 +200,10 @@ struct iommufd_viommu_ops {
> > struct device *dev,
> > u64 virt_id);
> > void (*vdevice_destroy)(struct iommufd_vdevice *vdev);
> > + struct iommufd_hw_queue *(*hw_queue_alloc)(
> > + struct iommufd_ucmd *ucmd, struct iommufd_viommu *viommu,
> > + unsigned int type, u32 index, u64 base_addr, size_t length);
>
> I think it would better to have two function pointers here than the flags:
>
> + struct iommufd_hw_queue *(*hw_queue_alloc)(
> + struct iommufd_ucmd *ucmd, struct iommufd_viommu *viommu,
> + unsigned int type, u32 index, u64 s2_iova, size_t length);
>
>
> + struct iommufd_hw_queue *(*hw_queue_alloc_phys)(
> + struct iommufd_ucmd *ucmd, struct iommufd_viommu *viommu,
> + unsigned int type, u32 index, phys_addr_t phys, size_t length);
OK. I think these two should be exclusive then. Maybe it needs a
WARN_ON in iommufd_viommu_alloc.
Thanks
Nicolin
Powered by blists - more mailing lists