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

2023-03-27 Thread Liu, Yi L
> From: Liu, Yi L > Sent: Friday, March 24, 2023 5:25 PM > > > From: Jason Gunthorpe > > Sent: Thursday, March 23, 2023 8:02 PM > > > > On Thu, Mar 23, 2023 at 03:15:20AM +, Liu, Yi L wrote: > > > > From: Jason Gunthorpe > > > > Sent: Wednesday, March 22, 2023 9:43 PM > > > > > > > > On

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

2023-03-24 Thread Jason Gunthorpe
On Fri, Mar 24, 2023 at 09:09:59AM +, Tian, Kevin wrote: > > From: Alex Williamson > > Sent: Wednesday, March 22, 2023 5:01 AM > > > > On Tue, 21 Mar 2023 17:50:08 -0300 > > Jason Gunthorpe wrote: > > > > > > > > Though it would be nice if qemu didn't need two implementations so Yi > > >

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

2023-03-24 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Thursday, March 23, 2023 8:02 PM > > On Thu, Mar 23, 2023 at 03:15:20AM +, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Wednesday, March 22, 2023 9:43 PM > > > > > > On Wed, Mar 22, 2023 at 01:33:09PM +, Liu, Yi L wrote: > > > > > > > Thanks.

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

2023-03-24 Thread Tian, Kevin
> From: Alex Williamson > Sent: Wednesday, March 22, 2023 5:01 AM > > On Tue, 21 Mar 2023 17:50:08 -0300 > Jason Gunthorpe wrote: > > > > > Though it would be nice if qemu didn't need two implementations so Yi > > I'd rather see a new info in this series as well and qemu can just > >

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

2023-03-23 Thread Jason Gunthorpe
On Thu, Mar 23, 2023 at 03:15:20AM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, March 22, 2023 9:43 PM > > > > On Wed, Mar 22, 2023 at 01:33:09PM +, Liu, Yi L wrote: > > > > > Thanks. So this new _INFO only reports a limited scope instead of > > > the full list of

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

2023-03-22 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, March 22, 2023 9:43 PM > > On Wed, Mar 22, 2023 at 01:33:09PM +, Liu, Yi L wrote: > > > Thanks. So this new _INFO only reports a limited scope instead of > > the full list of affected devices. Also, it is not static scope since device > > may be

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

2023-03-22 Thread Jason Gunthorpe
On Wed, Mar 22, 2023 at 01:33:09PM +, Liu, Yi L wrote: > Thanks. So this new _INFO only reports a limited scope instead of > the full list of affected devices. Also, it is not static scope since device > may be opened just after the _INFO returns. Yes, it would be simplest for qemu to do the

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

2023-03-22 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, March 22, 2023 8:18 PM > > On Wed, Mar 22, 2023 at 08:17:54AM +, Liu, Yi L wrote: > > > Could you elaborate what is required with _INFO before libvirt can > > use a FD pass? > > Make a new _INFO that returns an array of dev_ids within the cdev's >

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

2023-03-22 Thread Jason Gunthorpe
On Wed, Mar 22, 2023 at 06:36:14AM -0600, Alex Williamson wrote: > On Wed, 22 Mar 2023 09:27:16 -0300 > Jason Gunthorpe wrote: > > > On Tue, Mar 21, 2023 at 04:47:37PM -0600, Alex Williamson wrote: > > > On Tue, 21 Mar 2023 19:20:37 -0300 > > > Jason Gunthorpe wrote: > > > > > > > On Tue,

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

2023-03-22 Thread Alex Williamson
On Wed, 22 Mar 2023 09:27:16 -0300 Jason Gunthorpe wrote: > On Tue, Mar 21, 2023 at 04:47:37PM -0600, Alex Williamson wrote: > > On Tue, 21 Mar 2023 19:20:37 -0300 > > Jason Gunthorpe wrote: > > > > > On Tue, Mar 21, 2023 at 03:01:12PM -0600, Alex Williamson wrote: > > > > > > > > Though

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

2023-03-22 Thread Jason Gunthorpe
On Tue, Mar 21, 2023 at 04:47:37PM -0600, Alex Williamson wrote: > On Tue, 21 Mar 2023 19:20:37 -0300 > Jason Gunthorpe wrote: > > > On Tue, Mar 21, 2023 at 03:01:12PM -0600, Alex Williamson wrote: > > > > > > Though it would be nice if qemu didn't need two implementations so Yi > > > > I'd

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

2023-03-22 Thread Alex Williamson
On Wed, 22 Mar 2023 04:42:16 + "Liu, Yi L" wrote: > > From: Alex Williamson > > Sent: Wednesday, March 22, 2023 6:48 AM > > > > On Tue, 21 Mar 2023 19:20:37 -0300 > > Jason Gunthorpe wrote: > > > > > On Tue, Mar 21, 2023 at 03:01:12PM -0600, Alex Williamson wrote: > > > > > > > >

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

2023-03-22 Thread Jason Gunthorpe
On Wed, Mar 22, 2023 at 08:17:54AM +, Liu, Yi L wrote: > Could you elaborate what is required with _INFO before libvirt can > use a FD pass? Make a new _INFO that returns an array of dev_ids within the cdev's iommufd_ctx that are part of the reset group, eg the devset. qemu will call this

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

2023-03-22 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, March 22, 2023 4:50 AM > > On Tue, Mar 21, 2023 at 02:31:22PM -0600, Alex Williamson wrote: > > > This just seems like nit-picking that the API could have accomplished > > this more concisely. Probably that's true, but I think you've > > identified a

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

2023-03-21 Thread Liu, Yi L
> From: Alex Williamson > Sent: Wednesday, March 22, 2023 6:48 AM > > On Tue, 21 Mar 2023 19:20:37 -0300 > Jason Gunthorpe wrote: > > > On Tue, Mar 21, 2023 at 03:01:12PM -0600, Alex Williamson wrote: > > > > > > Though it would be nice if qemu didn't need two implementations so Yi > > > > I'd

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

2023-03-21 Thread Alex Williamson
On Tue, 21 Mar 2023 19:20:37 -0300 Jason Gunthorpe wrote: > On Tue, Mar 21, 2023 at 03:01:12PM -0600, Alex Williamson wrote: > > > > Though it would be nice if qemu didn't need two implementations so Yi > > > I'd rather see a new info in this series as well and qemu can just > > > consistently

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

2023-03-21 Thread Jason Gunthorpe
On Tue, Mar 21, 2023 at 03:01:12PM -0600, Alex Williamson wrote: > > Though it would be nice if qemu didn't need two implementations so Yi > > I'd rather see a new info in this series as well and qemu can just > > consistently use dev_id and never bdf in iommufd mode. > > We also need to

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

2023-03-21 Thread Alex Williamson
On Tue, 21 Mar 2023 17:50:08 -0300 Jason Gunthorpe wrote: > On Tue, Mar 21, 2023 at 02:31:22PM -0600, Alex Williamson wrote: > > > This just seems like nit-picking that the API could have accomplished > > this more concisely. Probably that's true, but I think you've > > identified a gap above

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

2023-03-21 Thread Jason Gunthorpe
On Tue, Mar 21, 2023 at 02:31:22PM -0600, Alex Williamson wrote: > This just seems like nit-picking that the API could have accomplished > this more concisely. Probably that's true, but I think you've > identified a gap above that amplifies the issue. If the user cannot > map BDFs to cdevs

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

2023-03-21 Thread Alex Williamson
On Mon, 20 Mar 2023 20:39:07 -0300 Jason Gunthorpe wrote: > On Mon, Mar 20, 2023 at 04:52:17PM -0600, Alex Williamson wrote: > > > > The APIs are well defined and userspace can always use them wrong. It > > > doesn't need to call RESET_INFO even today, it can just trivially pass > > > every

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

2023-03-20 Thread Jason Gunthorpe
On Mon, Mar 20, 2023 at 04:52:17PM -0600, Alex Williamson wrote: > > The APIs are well defined and userspace can always use them wrong. It > > doesn't need to call RESET_INFO even today, it can just trivially pass > > every group FD it owns to meet the security check. > > That's not actually

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

2023-03-20 Thread Alex Williamson
On Mon, 20 Mar 2023 14:14:48 -0300 Jason Gunthorpe wrote: > On Fri, Mar 17, 2023 at 09:15:57AM -0600, Alex Williamson wrote: > > > If that is the intended usage then I don't see why this proposal will > > > promote userspace to ignore the _INFO ioctl. It should be always > > > queried no matter

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

2023-03-20 Thread Jason Gunthorpe
On Fri, Mar 17, 2023 at 09:15:57AM -0600, Alex Williamson wrote: > > If that is the intended usage then I don't see why this proposal will > > promote userspace to ignore the _INFO ioctl. It should be always > > queried no matter how the reset ioctl itself is designed. The motivation > > of

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

2023-03-17 Thread Alex Williamson
On Fri, 17 Mar 2023 00:57:23 + "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Friday, March 17, 2023 8:23 AM > > > > On Thu, 16 Mar 2023 23:29:21 + > > "Tian, Kevin" wrote: > > > > > > From: Alex Williamson > > > > Sent: Friday, March 17, 2023 2:46 AM > > > > > > > > On

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 Tian, Kevin
> From: Alex Williamson > Sent: Friday, March 17, 2023 8:23 AM > > On Thu, 16 Mar 2023 23:29:21 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Friday, March 17, 2023 2:46 AM > > > > > > On Wed, 15 Mar 2023 23:31:23 + > > > "Tian, Kevin" wrote: > > > > > > > > From:

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 Alex Williamson
On Thu, 16 Mar 2023 23:29:21 + "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Friday, March 17, 2023 2:46 AM > > > > On Wed, 15 Mar 2023 23:31:23 + > > "Tian, Kevin" wrote: > > > > > > From: Alex Williamson > > > > Sent: Thursday, March 16, 2023 6:53 AM > > > > I'm afraid

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 Tian, Kevin
> From: Alex Williamson > Sent: Friday, March 17, 2023 2:46 AM > > On Wed, 15 Mar 2023 23:31:23 + > "Tian, Kevin" wrote: > > > > From: Alex Williamson > > > Sent: Thursday, March 16, 2023 6:53 AM > > > I'm afraid this proposal reduces or eliminates the handshake we have > > > with

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 Alex Williamson
On Wed, 15 Mar 2023 23:31:23 + "Tian, Kevin" wrote: > > From: Alex Williamson > > Sent: Thursday, March 16, 2023 6:53 AM > > > > On Wed, 8 Mar 2023 05:28:51 -0800 > > Yi Liu wrote: > > > > > This is another method to issue PCI hot reset for the users that bounds > > > device to a

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 Liu, Yi L
> From: Nicolin Chen > Sent: Thursday, March 16, 2023 2:49 PM > > 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

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 v6 12/24] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-03-16 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Thursday, March 16, 2023 2:10 PM > > > From: Liu, Yi L > > Sent: Thursday, March 16, 2023 11:55 AM > > > > > From: Tian, Kevin > > > Sent: Thursday, March 16, 2023 7:31 AM > > > > > > > From: Alex Williamson > > > > Sent: Thursday, March 16, 2023 6:53 AM > > > > >

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 Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, March 16, 2023 11:55 AM > > > From: Tian, Kevin > > Sent: Thursday, March 16, 2023 7:31 AM > > > > > From: Alex Williamson > > > Sent: Thursday, March 16, 2023 6:53 AM > > > > > > On Wed, 8 Mar 2023 05:28:51 -0800 > > > Yi Liu wrote: > > > > > > > This is

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

2023-03-15 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, March 16, 2023 6:53 AM > > On Wed, 8 Mar 2023 05:28:51 -0800 > Yi Liu wrote: > > > This is another method to issue PCI hot reset for the users that bounds > > device to a positive iommufd value. In such case, iommufd is a proof of > > device

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

2023-03-15 Thread Alex Williamson
On Wed, 8 Mar 2023 05:28:51 -0800 Yi Liu wrote: > This is another method to issue PCI hot reset for the users that bounds > device to a positive iommufd value. In such case, iommufd is a proof of > device ownership. By passing a zero-length fd array, user indicates kernel > to do ownership

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

2023-03-10 Thread Jason Gunthorpe
On Fri, Mar 10, 2023 at 06:04:02AM +, Liu, Yi L wrote: > > From: Tian, Kevin > > Sent: Friday, March 10, 2023 1:31 PM > > > > > From: Yi Liu > > > Sent: Wednesday, March 8, 2023 9:29 PM > > > > > > This is another method to issue PCI hot reset for the users that bounds > > > device to a

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

2023-03-10 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Friday, March 10, 2023 2:04 PM > > > + * > > > + * In the last case all affected devices which are opened by this user > > > + * must have been bound to a same iommufd_ctx. This approach is only > > > + * available for devices bound to positive iommufd. > > > > As we

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

2023-03-09 Thread Liu, Yi L
> From: Tian, Kevin > Sent: Friday, March 10, 2023 1:31 PM > > > From: Yi Liu > > Sent: Wednesday, March 8, 2023 9:29 PM > > > > This is another method to issue PCI hot reset for the users that bounds > > device to a positive iommufd value. In such case, iommufd is a proof of > > device

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

2023-03-09 Thread Tian, Kevin
> From: Yi Liu > Sent: Wednesday, March 8, 2023 9:29 PM > > This is another method to issue PCI hot reset for the users that bounds > device to a positive iommufd value. In such case, iommufd is a proof of > device ownership. By passing a zero-length fd array, user indicates kernel > to do