[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL v3 15/32] vfio: Add ioctl to get dirty pages bitmap during dma
From: |
zhukeqian |
Subject: |
Re: [PULL v3 15/32] vfio: Add ioctl to get dirty pages bitmap during dma unmap |
Date: |
Tue, 15 Dec 2020 16:06:11 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 |
Hi Kirti,
On 2020/11/2 5:01, Alex Williamson wrote:
> From: Kirti Wankhede <kwankhede@nvidia.com>
>
> With vIOMMU, IO virtual address range can get unmapped while in pre-copy
> phase of migration. In that case, unmap ioctl should return pages pinned
> in that range and QEMU should find its correcponding guest physical
> addresses and report those dirty.
>
> Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
> Reviewed-by: Neo Jia <cjia@nvidia.com>
> [aw: fix error_report types, fix cpu_physical_memory_set_dirty_lebitmap()
> cast]
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
> hw/vfio/common.c | 97
> ++++++++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 93 insertions(+), 4 deletions(-)
>
[...]
> +
> + unmap->argsz = sizeof(*unmap) + sizeof(*bitmap);
> + unmap->iova = iova;
> + unmap->size = size;
> + unmap->flags |= VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP;
> + bitmap = (struct vfio_bitmap *)&unmap->data;
> +
> + /*
> + * cpu_physical_memory_set_dirty_lebitmap() expects pages in bitmap of
> + * TARGET_PAGE_SIZE to mark those dirty. Hence set bitmap_pgsize to
> + * TARGET_PAGE_SIZE.
> + */
Here maybe not OK. cpu_physical_memory_set_dirty_lebitmap expects the granule
of bitmap is qemu_real_host_page_size. It uses hpratio to covert this bitmap
to QEMU dirty bitmap.
Thanks,
Keqian
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PULL v3 15/32] vfio: Add ioctl to get dirty pages bitmap during dma unmap,
zhukeqian <=