Re: [Intel-gfx] [PATCH v12 14/24] iommufd/device: Add iommufd_access_detach() API

2023-06-25 Thread Nicolin Chen
On Fri, Jun 23, 2023 at 11:15:40AM -0300, Jason Gunthorpe wrote: > > +static void __iommufd_access_detach(struct iommufd_access *access) > > +{ > > + struct iommufd_ioas *cur_ioas = access->ioas; > > + > > + lockdep_assert_held(>ioas_lock); > > + /* > > +* Set ioas to NULL to block any

Re: [Intel-gfx] [PATCH v12 00/24] Add vfio_device cdev for iommufd support

2023-06-07 Thread Nicolin Chen
anch, and tested with an updated QEMU branch on ARM64 (SMMUv3): https://github.com/nicolinc/iommufd/commits/wip/iommufd_nesting-06052023-cdev-v12-nic https://github.com/nicolinc/qemu/commits/wip/iommufd_nesting-06062023 Tested-by: Nicolin Chen Thanks Nicolin

Re: [Intel-gfx] [PATCH v8 16/24] iommufd/device: Add iommufd_access_detach() API

2023-03-28 Thread Nicolin Chen
On Mon, Mar 27, 2023 at 07:23:57PM -0700, Jon Pan-Doh wrote: > External email: Use caution opening links or attachments > > > On 2023/3/27 02:40, Yi Liu wrote: > > diff --git a/drivers/iommu/iommufd/iommufd_private.h > > b/drivers/iommu/iommufd/iommufd_private.h > > index

Re: [Intel-gfx] [PATCH v8 00/24] Add vfio_device cdev for iommufd support

2023-03-27 Thread Nicolin Chen
efix to be par with >group path > - Add r-b from Kevin > - Add t-b from Terrence This runs well with iommufd selftest on x86 and QEMU sanity on ARM64, applying nesting series on top of this series: https://github.com/nicolinc/iommufd/commits/wip/iommufd_nesting-03272023 Tested-by: Nicolin Chen

Re: [Intel-gfx] [PATCH v3 0/6] vfio: Make emulated devices prepared for vfio device cdev

2023-03-27 Thread Nicolin Chen
ufd_get_ioas(). (Jason) > - Add r-b from Jason and Kevin > - Add t-b from Terrence Xu This runs well with iommufd selftest on x86 and QEMU sanity on ARM64, applying nesting series on top of this and cdev series: https://github.com/nicolinc/iommufd/commits/wip/iommufd_nesting-03272023 Tested-by: Nicolin Chen

Re: [Intel-gfx] [PATCH v6 12/24] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-03-16 Thread Nicolin Chen
On Thu, Mar 16, 2023 at 01:22:58PM +, Liu, Yi L wrote: > > And regarding the new baseline for the replace series and the > > nesting series, it'd be nicer to have another one git-merging > > your cdev v7 branch on top of Jason's iommufd_hwpt branch. We > > could wait for him updating to

Re: [Intel-gfx] [PATCH v6 12/24] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-03-16 Thread Nicolin Chen
On Thu, Mar 16, 2023 at 06:28:28AM +, Liu, Yi L wrote: > > Anyway let's not wait here. Send your v7 and we can have more > > focused discussion in your split series about hot reset. > > Sure. Once Nicolin's patch is updated, I can send v7 with the hot > reset series as well. I've updated

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Thu, Mar 16, 2023 at 05:49:20AM +, Tian, Kevin wrote: > External email: Use caution opening links or attachments > > > > From: Nicolin Chen > > Sent: Thursday, March 16, 2023 1:44 PM > > > > On Thu, Mar 16, 2023 at 05:38:41AM +, Tian, Kevin wrote:

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Thu, Mar 16, 2023 at 05:38:41AM +, Tian, Kevin wrote: > External email: Use caution opening links or attachments > > > > From: Nicolin Chen > > Sent: Thursday, March 16, 2023 1:33 PM > > > > Hi Kevin, > > > > I've fixed the other two commits.

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
Hi Kevin, I've fixed the other two commits. Here is the one that I am not sure about: On Thu, Mar 16, 2023 at 02:53:50AM +, Tian, Kevin wrote: > > [2] This adds iommufd_access_detach() in the cdev series: > > "iommufd/device: Add iommufd_access_detach() API" > > > >

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Thu, Mar 16, 2023 at 02:53:50AM +, Tian, Kevin wrote: > > Please check if they look okay, so that Yi can integrate them > > accordingly to the emulated/cdev series. > > this split looks reasonable to me. Go ahead. Thanks for the review! I will address those comments and renew those

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Wed, Mar 15, 2023 at 12:18:01PM +, Liu, Yi L wrote: > > OK. Basically I followed what Jason suggested by having three > > APIs and combined Kevin's inputs about the difference between > > the attach/replace(). I also updated the replace changes, and > > rebased all nesting (infrastructure,

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Thu, Mar 16, 2023 at 12:17:11AM +, Tian, Kevin wrote: > > > > > > > > @@ -449,33 +450,18 @@ iommufd_access_create(struct > > > > iommufd_ctx > > > > > > > > refcount_inc(>obj.users); > > > > > > > > + mutex_init(>ioas_lock); > > > > > > > > access->ictx = ictx; > > > > > >

Re: [Intel-gfx] [PATCH v5 00/19] Add vfio_device cdev for iommufd support

2023-03-15 Thread Nicolin Chen
On Tue, Mar 14, 2023 at 11:38:11AM +, Shameerali Kolothum Thodi wrote: > Hi Nicolin, > > I rebased your latest Qemu branch[1] on top of v7.2.0 and not observed > the above issue so far. However noticed couple of other issues when > we try to hot add/remove devices. > > (qemu) device_del

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
Hi, On Wed, Mar 15, 2023 at 06:50:53AM +, Tian, Kevin wrote: > > So, this preparatory series will add a pair of simple attach() > > and detach() APIs. Then the cdev series will add the locking > > and the ioas_unpin stuff as a rework of the detach() API. > > I think they can be something

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Wed, Mar 15, 2023 at 06:15:23AM +, Tian, Kevin wrote: > External email: Use caution opening links or attachments > > > > From: Nicolin Chen > > Sent: Wednesday, March 15, 2023 9:01 AM > > > > Hi Jason/Kevin, > > > > > > > > Perhap

Re: [Intel-gfx] [PATCH v6 19/24] vfio-iommufd: Add detach_ioas support for emulated VFIO devices

2023-03-15 Thread Nicolin Chen
On Wed, Mar 15, 2023 at 06:15:02AM +, Liu, Yi L wrote: > > > +void vfio_iommufd_emulated_detach_ioas(struct vfio_device *vdev) > > > +{ > > > + lockdep_assert_held(>dev_set->lock); > > > + > > > + if (WARN_ON(!vdev->iommufd_access)) > > > + return; > > > + > > [...]

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-15 Thread Nicolin Chen
On Wed, Mar 15, 2023 at 06:16:37AM +, Tian, Kevin wrote: > External email: Use caution opening links or attachments > > > > From: Nicolin Chen > > Sent: Wednesday, March 15, 2023 2:51 AM > > > > On Fri, Mar 10, 2023 at 02:08:15AM +, Tian, Kevin wrote:

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-14 Thread Nicolin Chen
Hi Jason/Kevin, On Tue, Mar 14, 2023 at 01:20:52AM -0700, Nicolin Chen wrote: > On Fri, Mar 10, 2023 at 01:36:22PM -0400, Jason Gunthorpe wrote: > > On Wed, Mar 08, 2023 at 05:13:36AM -0800, Yi Liu wrote: > > > > > +int iommufd_access_set_ioas(struct iommufd_acc

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-14 Thread Nicolin Chen
On Fri, Mar 10, 2023 at 02:08:15AM +, Tian, Kevin wrote: > External email: Use caution opening links or attachments > > > > From: Liu, Yi L > > Sent: Wednesday, March 8, 2023 9:14 PM > > > > @@ -449,33 +450,18 @@ iommufd_access_create(struct iommufd_ctx *ictx, > > u32 ioas_id, > >

Re: [Intel-gfx] [PATCH v1 1/5] iommufd: Create access in vfio_iommufd_emulated_bind()

2023-03-14 Thread Nicolin Chen
On Fri, Mar 10, 2023 at 01:36:22PM -0400, Jason Gunthorpe wrote: > On Wed, Mar 08, 2023 at 05:13:36AM -0800, Yi Liu wrote: > > > +int iommufd_access_set_ioas(struct iommufd_access *access, u32 ioas_id) > > +{ > > + struct iommufd_ioas *new_ioas = NULL, *cur_ioas; > > + struct iommufd_ctx

Re: [Intel-gfx] [PATCH v6 19/24] vfio-iommufd: Add detach_ioas support for emulated VFIO devices

2023-03-10 Thread Nicolin Chen
On Wed, Mar 08, 2023 at 05:28:58AM -0800, Yi Liu wrote: > External email: Use caution opening links or attachments > > > this prepares for adding DETACH ioctl for emulated VFIO devices. > > Signed-off-by: Yi Liu > Reviewed-by: Kevin Tian > Tested-by: Terrence Xu &

Re: [Intel-gfx] [PATCH v5 00/19] Add vfio_device cdev for iommufd support

2023-03-03 Thread Nicolin Chen
On Fri, Mar 03, 2023 at 03:01:03PM +, Shameerali Kolothum Thodi wrote: > External email: Use caution opening links or attachments > > > > -Original Message- > > From: Nicolin Chen [mailto:nicol...@nvidia.com] > > Sent: 02 March 2023 23:51 > > To: Sham

Re: [Intel-gfx] [PATCH v5 00/19] Add vfio_device cdev for iommufd support

2023-03-02 Thread Nicolin Chen
On Thu, Mar 02, 2023 at 09:43:00AM +, Shameerali Kolothum Thodi wrote: > Hi Nicolin, > > Thanks for the latest ARM64 branch. Do you have a working Qemu branch > corresponding to the > above one? > > I tried the > https://github.com/nicolinc/qemu/tree/wip/iommufd_rfcv3%2Bnesting%2Bsmmuv3

Re: [Intel-gfx] [PATCH v5 00/19] Add vfio_device cdev for iommufd support

2023-02-28 Thread Nicolin Chen
egative > tests. > > Tested-by: Terrence Xu Sanity-tested this series on ARM64 with my wip branch: https://github.com/nicolinc/iommufd/commits/wip/iommufd-v6.2-nesting (Covering new iommufd and vfio-compat) Tested-by: Nicolin Chen

Re: [Intel-gfx] [PATCH v2 00/11] Connect VFIO to IOMMUFD

2022-11-08 Thread Nicolin Chen
On Mon, Nov 07, 2022 at 08:52:44PM -0400, Jason Gunthorpe wrote: > This is on github: https://github.com/jgunthorpe/linux/commits/vfio_iommufd [...] > v2: > - Rebase to v6.1-rc3, v4 iommufd series > - Fixup comments and commit messages from list remarks > - Fix leaking of the iommufd for mdevs

Re: [Intel-gfx] [PATCH v2 07/11] vfio-iommufd: Support iommufd for physical VFIO devices

2022-11-07 Thread Nicolin Chen
On Mon, Nov 07, 2022 at 08:52:51PM -0400, Jason Gunthorpe wrote: > @@ -795,6 +800,10 @@ static int vfio_device_first_open(struct vfio_device > *device) > ret = vfio_group_use_container(device->group); > if (ret) > goto err_module_put; > + }

Re: [Intel-gfx] [PATCH 06/10] vfio-iommufd: Allow iommufd to be used in place of a container fd

2022-11-01 Thread Nicolin Chen
On Tue, Nov 01, 2022 at 08:09:52AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, October 26, 2022 2:51 AM > > > > menuconfig VFIO > > tristate "VFIO Non-Privileged userspace driver framework" > > select IOMMU_API > > + depends on IOMMUFD || !IOMMUFD >

Re: [Intel-gfx] [PATCH 00/10] Connect VFIO to IOMMUFD

2022-10-31 Thread Nicolin Chen
On Tue, Nov 01, 2022 at 11:04:38AM +0800, Yi Liu wrote: > On 2022/11/1 07:24, Jason Gunthorpe wrote: > > On Mon, Oct 31, 2022 at 08:25:39PM +0800, Yi Liu wrote: > > > > There is something wrong with the test suite that it isn't covering > > > > the above, I'm going to look into that today. > > >

Re: [Intel-gfx] [PATCH 00/10] Connect VFIO to IOMMUFD

2022-10-31 Thread Nicolin Chen
r the Intel GVT mdev. Aside from > the temporary limitation with P2P memory this is belived to be fully > compatible with VFIO. > > This is on github: https://github.com/jgunthorpe/linux/commits/vfio_iommufd Tested-by: Nicolin Chen Tested this branch on ARM64+SMMUv3 with the iommufd s

Re: [Intel-gfx] [PATCH 00/10] Connect VFIO to IOMMUFD

2022-10-31 Thread Nicolin Chen
On Fri, Oct 28, 2022 at 04:53:21PM -0700, Nicolin Chen wrote: > On Tue, Oct 25, 2022 at 03:17:06PM -0300, Jason Gunthorpe wrote: > > This series provides an alternative container layer for VFIO implemented > > using iommufd. This is optional, if CONFIG_IOM