[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <663c7eee-5a3a-48e5-8bed-8abad62f3484@linux.intel.com>
Date: Tue, 10 Jun 2025 13:55:05 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Nicolin Chen <nicolinc@...dia.com>, jgg@...dia.com, kevin.tian@...el.com
Cc: will@...nel.org, robin.murphy@....com, joro@...tes.org,
ddutile@...hat.com, yi.l.liu@...el.com, peterz@...radead.org,
jsnitsel@...hat.com, praan@...gle.com, linux-arm-kernel@...ts.infradead.org,
iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH v1 08/12] iommufd/viommu: Replace ops->viommu_alloc with
ops->viommu_init
On 6/10/25 01:13, Nicolin Chen wrote:
> To ease the for-driver iommufd APIs, get_viommu_size and viommu_init ops
> are introduced. Now, those existing vIOMMU supported drivers implemented
> these two ops too.
>
> Relace the ops->viommu_alloc call with the two new ones.
>
> Note that this will fail a !viommu->ops case from now on, since a vIOMMU
> is expected to support alloc_domain_nested at least.
Does this mean that the viommu implementation in the iommu driver is
required to implement alloc_domain_nested? I suppose viommu should soon
be extended to support TEE/IO.
>
> Suggested-by: Jason Gunthorpe<jgg@...dia.com>
> Signed-off-by: Nicolin Chen<nicolinc@...dia.com>
> ---
> drivers/iommu/iommufd/viommu.c | 30 +++++++++++++++++++++++++++---
> 1 file changed, 27 insertions(+), 3 deletions(-)
>
<...>
> @@ -68,6 +82,16 @@ int iommufd_viommu_alloc_ioctl(struct iommufd_ucmd *ucmd)
> */
> viommu->iommu_dev = __iommu_get_iommu_dev(idev->dev);
>
> + rc = ops->viommu_init(viommu, hwpt_paging->common.domain);
> + if (rc)
> + goto out_abort;
> +
> + /* It is a driver bug that viommu->ops isn't filled */
> + if (WARN_ON_ONCE(!viommu->ops)) {
> + rc = -EINVAL;
> + goto out_abort;
> + }
> +
> cmd->out_viommu_id = viommu->obj.id;
> rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd));
> if (rc)
Thanks,
baolu
Powered by blists - more mailing lists