Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-17 Thread Jason Gunthorpe
On Thu, Oct 17, 2024 at 10:01:28AM -0700, Nicolin Chen wrote: > On Thu, Oct 17, 2024 at 01:33:59PM -0300, Jason Gunthorpe wrote: > > > > diff --git a/drivers/iommu/iommufd/viommu_api.c > > > b/drivers/iommu/iommufd/viommu_api.c > > > new file mode 100644 > > > index ..c1731f080d6b > >

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-17 Thread Nicolin Chen
On Thu, Oct 17, 2024 at 01:33:59PM -0300, Jason Gunthorpe wrote: > > diff --git a/drivers/iommu/iommufd/viommu_api.c > > b/drivers/iommu/iommufd/viommu_api.c > > new file mode 100644 > > index ..c1731f080d6b > > --- /dev/null > > +++ b/drivers/iommu/iommufd/viommu_api.c > > Let's cal

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-17 Thread Jason Gunthorpe
On Wed, Oct 09, 2024 at 09:38:03AM -0700, Nicolin Chen wrote: > + struct iommufd_viommu *(*viommu_alloc)(struct iommu_device *iommu_dev, > +struct iommu_domain *domain, Let's call this parent_domain ie nesting parent > +/* > + * Helpers for IOMMU dr

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-16 Thread Zhangfei Gao
On Wed, 16 Oct 2024 at 14:52, Nicolin Chen wrote: > > On Wed, Oct 16, 2024 at 09:56:51AM +0800, Zhangfei Gao wrote: > > On Wed, 16 Oct 2024 at 02:44, Nicolin Chen wrote: > > > > > > On Mon, Oct 14, 2024 at 07:01:40PM -0700, Nicolin Chen wrote: > > > > On Tue, Oct 15, 2024 at 09:15:01AM +0800, Zha

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-15 Thread Nicolin Chen
On Wed, Oct 16, 2024 at 09:56:51AM +0800, Zhangfei Gao wrote: > On Wed, 16 Oct 2024 at 02:44, Nicolin Chen wrote: > > > > On Mon, Oct 14, 2024 at 07:01:40PM -0700, Nicolin Chen wrote: > > > On Tue, Oct 15, 2024 at 09:15:01AM +0800, Zhangfei Gao wrote: > > > > > > > > > iommufd_device_bind > > > >

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-15 Thread Zhangfei Gao
On Wed, 16 Oct 2024 at 02:44, Nicolin Chen wrote: > > On Mon, Oct 14, 2024 at 07:01:40PM -0700, Nicolin Chen wrote: > > On Tue, Oct 15, 2024 at 09:15:01AM +0800, Zhangfei Gao wrote: > > > > > > > iommufd_device_bind > > > > > iommufd_device_attach > > > > > iommufd_vdevice_alloc_ioctl > > > > > >

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-15 Thread Nicolin Chen
On Mon, Oct 14, 2024 at 07:01:40PM -0700, Nicolin Chen wrote: > On Tue, Oct 15, 2024 at 09:15:01AM +0800, Zhangfei Gao wrote: > > > > > iommufd_device_bind > > > > iommufd_device_attach > > > > iommufd_vdevice_alloc_ioctl > > > > > > > > iommufd_device_detach > > > > iommufd_device_unbind // refco

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-14 Thread Nicolin Chen
On Tue, Oct 15, 2024 at 09:15:01AM +0800, Zhangfei Gao wrote: > > > iommufd_device_bind > > > iommufd_device_attach > > > iommufd_vdevice_alloc_ioctl > > > > > > iommufd_device_detach > > > iommufd_device_unbind // refcount check fail > > > iommufd_vdevice_destroy ref-- > > > > Things should be sy

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-14 Thread Zhangfei Gao
On Mon, 14 Oct 2024 at 23:46, Nicolin Chen wrote: > > On Mon, Oct 14, 2024 at 03:58:55PM +0800, Zhangfei Gao wrote: > > > > > > > +struct iommufd_object *iommufd_object_alloc_elm(struct iommufd_ctx > > > > > > *ictx, > > > > > > + size_t size, > > > >

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-14 Thread Nicolin Chen
On Mon, Oct 14, 2024 at 03:58:55PM +0800, Zhangfei Gao wrote: > > > > > +struct iommufd_object *iommufd_object_alloc_elm(struct iommufd_ctx > > > > > *ictx, > > > > > + size_t size, > > > > > + enum > > >

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-14 Thread Zhangfei Gao
Hi, Nico On Sat, 12 Oct 2024 at 18:18, Zhangfei Gao wrote: > > On Sat, 12 Oct 2024 at 12:49, Nicolin Chen wrote: > > > > On Sat, Oct 12, 2024 at 11:23:07AM +0800, Zhangfei Gao wrote: > > > > > > diff --git a/drivers/iommu/iommufd/viommu_api.c > > > > b/drivers/iommu/iommufd/viommu_api.c > > > >

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-12 Thread Zhangfei Gao
On Sat, 12 Oct 2024 at 12:49, Nicolin Chen wrote: > > On Sat, Oct 12, 2024 at 11:23:07AM +0800, Zhangfei Gao wrote: > > > > diff --git a/drivers/iommu/iommufd/viommu_api.c > > > b/drivers/iommu/iommufd/viommu_api.c > > > new file mode 100644 > > > index ..c1731f080d6b > > > --- /dev/n

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-11 Thread Nicolin Chen
On Sat, Oct 12, 2024 at 11:23:07AM +0800, Zhangfei Gao wrote: > > diff --git a/drivers/iommu/iommufd/viommu_api.c > > b/drivers/iommu/iommufd/viommu_api.c > > new file mode 100644 > > index ..c1731f080d6b > > --- /dev/null > > +++ b/drivers/iommu/iommufd/viommu_api.c > > @@ -0,0 +1,5

Re: [PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-11 Thread Zhangfei Gao
On Thu, 10 Oct 2024 at 00:40, Nicolin Chen wrote: > > Add a new IOMMUFD_OBJ_VIOMMU with an iommufd_viommu structure to represent > a slice of physical IOMMU device passed to or shared with a user space VM. > This slice, now a vIOMMU object, is a group of virtualization resources of > a physical IO

[PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-09 Thread Nicolin Chen
Add a new IOMMUFD_OBJ_VIOMMU with an iommufd_viommu structure to represent a slice of physical IOMMU device passed to or shared with a user space VM. This slice, now a vIOMMU object, is a group of virtualization resources of a physical IOMMU's, such as: - Security namespace for guest owned ID, e.g