Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-14 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, June 14, 2023 9:38 PM > > On Wed, Jun 14, 2023 at 01:05:45PM +, Liu, Yi L wrote: > > > -EAGAIN basically means the kernel internally malfunctioned - eg it > > > allocated too little space for the actual size of devices. That is no > > > longer

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-14 Thread Jason Gunthorpe
On Wed, Jun 14, 2023 at 01:05:45PM +, Liu, Yi L wrote: > > -EAGAIN basically means the kernel internally malfunctioned - eg it > > allocated too little space for the actual size of devices. That is no > > longer possible in this version so it should never return -EAGAIN. > > I still have one

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-14 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, June 14, 2023 8:17 PM > > On Wed, Jun 14, 2023 at 10:35:10AM +, Liu, Yi L wrote: > > > > - if (fill->cur == fill->max) > > > - return -EAGAIN; /* Something changed, try again */ > > > + if (fill->devices_end >= fill->devices) > > > +

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-14 Thread Jason Gunthorpe
On Wed, Jun 14, 2023 at 10:35:10AM +, Liu, Yi L wrote: > > - if (fill->cur == fill->max) > > - return -EAGAIN; /* Something changed, try again */ > > + if (fill->devices_end >= fill->devices) > > + return -ENOSPC; > > This should be fill->devices_end <= fill->devices.

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-14 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, June 14, 2023 2:23 AM > > On Fri, Jun 02, 2023 at 05:15:14AM -0700, Yi Liu wrote: > > This allows VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl use the iommufd_ctx > > of the cdev device to check the ownership of the other affected devices. > > > > When

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-13 Thread Jason Gunthorpe
On Fri, Jun 02, 2023 at 05:15:14AM -0700, Yi Liu wrote: > This allows VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl use the iommufd_ctx > of the cdev device to check the ownership of the other affected devices. > > When VFIO_DEVICE_GET_PCI_HOT_RESET_INFO is called on an IOMMUFD managed > device, the

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-13 Thread Jason Gunthorpe
On Tue, Jun 13, 2023 at 08:32:29AM -0600, Alex Williamson wrote: > On Tue, 13 Jun 2023 12:50:43 + > "Liu, Yi L" wrote: > > > > From: Jason Gunthorpe > > > Sent: Tuesday, June 13, 2023 7:47 PM > > > > > > On Fri, Jun 02, 2023 at 05:15:14AM -0700, Yi Liu wrote: > > > > +/* > > > > + *

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-13 Thread Alex Williamson
On Tue, 13 Jun 2023 12:50:43 + "Liu, Yi L" wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, June 13, 2023 7:47 PM > > > > On Fri, Jun 02, 2023 at 05:15:14AM -0700, Yi Liu wrote: > > > +/* > > > + * Return devid for a device which is affected by hot-reset. > > > + * - valid devid > 0

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-13 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, June 13, 2023 7:47 PM > > On Fri, Jun 02, 2023 at 05:15:14AM -0700, Yi Liu wrote: > > +/* > > + * Return devid for a device which is affected by hot-reset. > > + * - valid devid > 0 for the device that is bound to the input > > + * iommufd_ctx. > > + *

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-13 Thread Jason Gunthorpe
On Fri, Jun 02, 2023 at 05:15:14AM -0700, Yi Liu wrote: > +/* > + * Return devid for a device which is affected by hot-reset. > + * - valid devid > 0 for the device that is bound to the input > + * iommufd_ctx. > + * - devid == VFIO_PCI_DEVID_OWNED for the device that has not > + * been bound

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-08 Thread Liu, Yi L
> From: Alex Williamson > Sent: Friday, June 9, 2023 6:27 AM > > On Fri, 2 Jun 2023 05:15:14 -0700 > Yi Liu wrote: > > > This allows VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl use the iommufd_ctx > > of the cdev device to check the ownership of the other affected devices. > > > > When

Re: [Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-08 Thread Alex Williamson
On Fri, 2 Jun 2023 05:15:14 -0700 Yi Liu wrote: > This allows VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl use the iommufd_ctx > of the cdev device to check the ownership of the other affected devices. > > When VFIO_DEVICE_GET_PCI_HOT_RESET_INFO is called on an IOMMUFD managed > device, the new

[Intel-gfx] [PATCH v7 8/9] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-06-02 Thread Yi Liu
This allows VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl use the iommufd_ctx of the cdev device to check the ownership of the other affected devices. When VFIO_DEVICE_GET_PCI_HOT_RESET_INFO is called on an IOMMUFD managed device, the new flag VFIO_PCI_HOT_RESET_FLAG_DEV_ID is reported to indicate the