Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-18 Thread Alex Williamson
On Wed, 19 Feb 2020 09:51:32 +0530 Kirti Wankhede wrote: > On 2/19/2020 3:11 AM, Alex Williamson wrote: > > On Tue, 18 Feb 2020 11:28:53 +0530 > > Kirti Wankhede wrote: > > > >> > >> > >>> As I understand the above algorithm, we find a vfio_dma > >>> overlapping the request

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-18 Thread Kirti Wankhede
On 2/19/2020 3:11 AM, Alex Williamson wrote: On Tue, 18 Feb 2020 11:28:53 +0530 Kirti Wankhede wrote: As I understand the above algorithm, we find a vfio_dma overlapping the request and populate the bitmap for that range. Then we go back and put_user() for each byte that we

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-18 Thread Alex Williamson
On Tue, 18 Feb 2020 11:28:53 +0530 Kirti Wankhede wrote: > > > >As I understand the above algorithm, we find a vfio_dma > > overlapping the request and populate the bitmap for that range. Then > > we go back and put_user() for each byte that we touched. We could > >

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-17 Thread Kirti Wankhede
As I understand the above algorithm, we find a vfio_dma overlapping the request and populate the bitmap for that range. Then we go back and put_user() for each byte that we touched. We could instead simply work on a one byte buffer as we enumerate the requested range and do a put_user()

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-17 Thread Alex Williamson
On Tue, 18 Feb 2020 00:43:48 +0530 Kirti Wankhede wrote: > On 2/14/2020 4:50 AM, Alex Williamson wrote: > > On Fri, 14 Feb 2020 01:41:35 +0530 > > Kirti Wankhede wrote: > > > >> > >> > >> > >> +static int vfio_iova_dirty_bitmap(struct vfio_iommu *iommu, > >> dma_addr_t

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-17 Thread Kirti Wankhede
On 2/14/2020 4:50 AM, Alex Williamson wrote: On Fri, 14 Feb 2020 01:41:35 +0530 Kirti Wankhede wrote: +static int vfio_iova_dirty_bitmap(struct vfio_iommu *iommu, dma_addr_t iova, + size_t size, uint64_t pgsize, +

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-13 Thread Alex Williamson
On Fri, 14 Feb 2020 01:41:35 +0530 Kirti Wankhede wrote: > > > > +static int vfio_iova_dirty_bitmap(struct vfio_iommu *iommu, dma_addr_t > iova, > + size_t size, uint64_t pgsize, > + unsigned char

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-13 Thread Kirti Wankhede
+static int vfio_iova_dirty_bitmap(struct vfio_iommu *iommu, dma_addr_t iova, + size_t size, uint64_t pgsize, + unsigned char __user *bitmap) +{ + struct vfio_dma *dma; + dma_addr_t i = iova, iova_limit; +

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-12 Thread Alex Williamson
On Thu, 13 Feb 2020 02:26:23 +0530 Kirti Wankhede wrote: > On 2/10/2020 10:55 PM, Alex Williamson wrote: > > On Sat, 8 Feb 2020 01:12:31 +0530 > > Kirti Wankhede wrote: > > > >> VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > >> - Start pinned and unpinned pages tracking while

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-12 Thread Kirti Wankhede
On 2/10/2020 10:55 PM, Alex Williamson wrote: On Sat, 8 Feb 2020 01:12:31 +0530 Kirti Wankhede wrote: VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: - Start pinned and unpinned pages tracking while migration is active - Stop pinned and unpinned dirty pages tracking. This is also

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-10 Thread Yan Zhao
On Tue, Feb 11, 2020 at 11:45:43AM +0800, Alex Williamson wrote: > On Mon, 10 Feb 2020 21:52:51 -0500 > Yan Zhao wrote: > > > On Tue, Feb 11, 2020 at 03:44:54AM +0800, Alex Williamson wrote: > > > On Mon, 10 Feb 2020 04:49:54 -0500 > > > Yan Zhao wrote: > > > > > > > On Sat, Feb 08, 2020 at

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-10 Thread Alex Williamson
On Mon, 10 Feb 2020 21:52:51 -0500 Yan Zhao wrote: > On Tue, Feb 11, 2020 at 03:44:54AM +0800, Alex Williamson wrote: > > On Mon, 10 Feb 2020 04:49:54 -0500 > > Yan Zhao wrote: > > > > > On Sat, Feb 08, 2020 at 03:42:31AM +0800, Kirti Wankhede wrote: > > > > VFIO_IOMMU_DIRTY_PAGES ioctl

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-10 Thread Yan Zhao
On Tue, Feb 11, 2020 at 03:44:54AM +0800, Alex Williamson wrote: > On Mon, 10 Feb 2020 04:49:54 -0500 > Yan Zhao wrote: > > > On Sat, Feb 08, 2020 at 03:42:31AM +0800, Kirti Wankhede wrote: > > > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > > > - Start pinned and unpinned pages

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-10 Thread Alex Williamson
On Mon, 10 Feb 2020 04:49:54 -0500 Yan Zhao wrote: > On Sat, Feb 08, 2020 at 03:42:31AM +0800, Kirti Wankhede wrote: > > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > > - Start pinned and unpinned pages tracking while migration is active > > - Stop pinned and unpinned dirty pages

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-10 Thread Alex Williamson
On Sat, 8 Feb 2020 01:12:31 +0530 Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start pinned and unpinned pages tracking while migration is active > - Stop pinned and unpinned dirty pages tracking. This is also used to > stop dirty pages tracking if

Re: [PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-10 Thread Yan Zhao
On Sat, Feb 08, 2020 at 03:42:31AM +0800, Kirti Wankhede wrote: > VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: > - Start pinned and unpinned pages tracking while migration is active > - Stop pinned and unpinned dirty pages tracking. This is also used to > stop dirty pages tracking if

[PATCH v12 Kernel 4/7] vfio iommu: Implementation of ioctl to for dirty pages tracking.

2020-02-07 Thread Kirti Wankhede
VFIO_IOMMU_DIRTY_PAGES ioctl performs three operations: - Start pinned and unpinned pages tracking while migration is active - Stop pinned and unpinned dirty pages tracking. This is also used to stop dirty pages tracking if migration failed or cancelled. - Get dirty pages bitmap. This ioctl