Re: [PATCH v6 05/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-11-07 Thread Jason Gunthorpe
On Thu, Nov 07, 2024 at 12:37:59PM +1100, Alexey Kardashevskiy wrote: > > + hwpt_paging = iommufd_get_hwpt_paging(ucmd, cmd->hwpt_id); > > + if (IS_ERR(hwpt_paging)) { > > + rc = PTR_ERR(hwpt_paging); > > + goto out_put_idev; > > + } > > + > > + if (!hwpt_paging->nest_pa

Re: [PATCH v6 05/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-11-06 Thread Nicolin Chen
On Thu, Nov 07, 2024 at 12:37:59PM +1100, Alexey Kardashevskiy wrote: > On 31/10/24 08:34, Nicolin Chen wrote: > > +int iommufd_viommu_alloc_ioctl(struct iommufd_ucmd *ucmd) > > +{ > > + struct iommu_viommu_alloc *cmd = ucmd->cmd; > > + struct iommufd_hwpt_paging *hwpt_paging; > > + str

Re: [PATCH v6 05/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-11-06 Thread Alexey Kardashevskiy
On 31/10/24 08:34, Nicolin Chen wrote: Add a new ioctl for user space to do a vIOMMU allocation. It must be based on a nesting parent HWPT, so take its refcount. IOMMU driver wanting to support vIOMMUs must define its IOMMU_VIOMMU_TYPE_ in the uAPI header and implement a viommu_alloc op in its i

[PATCH v6 05/13] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-30 Thread Nicolin Chen
Add a new ioctl for user space to do a vIOMMU allocation. It must be based on a nesting parent HWPT, so take its refcount. IOMMU driver wanting to support vIOMMUs must define its IOMMU_VIOMMU_TYPE_ in the uAPI header and implement a viommu_alloc op in its iommu_ops. Reviewed-by: Jason Gunthorpe