vfio: Rename vfio_get_dirty_bitmap()

Rename to vfio_container_query_dirty_bitmap() to be consistent with
the VFIO container routine naming scheme.

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-32-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
This commit is contained in:
Cédric Le Goater 2025-03-26 08:51:16 +01:00
parent 60f29d0823
commit c51358bd17
5 changed files with 10 additions and 9 deletions

View file

@ -1002,7 +1002,7 @@ static void vfio_iommu_map_dirty_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb)
goto out_unlock; goto out_unlock;
} }
ret = vfio_get_dirty_bitmap(bcontainer, iova, iotlb->addr_mask + 1, ret = vfio_container_query_dirty_bitmap(bcontainer, iova, iotlb->addr_mask + 1,
translated_addr, &local_err); translated_addr, &local_err);
if (ret) { if (ret) {
error_prepend(&local_err, error_prepend(&local_err,
@ -1039,7 +1039,7 @@ static int vfio_ram_discard_get_dirty_bitmap(MemoryRegionSection *section,
* Sync the whole mapped region (spanning multiple individual mappings) * Sync the whole mapped region (spanning multiple individual mappings)
* in one go. * in one go.
*/ */
ret = vfio_get_dirty_bitmap(vrdl->bcontainer, iova, size, ram_addr, ret = vfio_container_query_dirty_bitmap(vrdl->bcontainer, iova, size, ram_addr,
&local_err); &local_err);
if (ret) { if (ret) {
error_report_err(local_err); error_report_err(local_err);
@ -1133,7 +1133,7 @@ static int vfio_sync_dirty_bitmap(VFIOContainerBase *bcontainer,
ram_addr = memory_region_get_ram_addr(section->mr) + ram_addr = memory_region_get_ram_addr(section->mr) +
section->offset_within_region; section->offset_within_region;
return vfio_get_dirty_bitmap(bcontainer, return vfio_container_query_dirty_bitmap(bcontainer,
REAL_HOST_PAGE_ALIGN(section->offset_within_address_space), REAL_HOST_PAGE_ALIGN(section->offset_within_address_space),
int128_get64(section->size), ram_addr, errp); int128_get64(section->size), ram_addr, errp);
} }

View file

@ -237,7 +237,7 @@ static int vfio_container_devices_query_dirty_bitmap(const VFIOContainerBase *bc
return 0; return 0;
} }
int vfio_get_dirty_bitmap(const VFIOContainerBase *bcontainer, uint64_t iova, int vfio_container_query_dirty_bitmap(const VFIOContainerBase *bcontainer, uint64_t iova,
uint64_t size, ram_addr_t ram_addr, Error **errp) uint64_t size, ram_addr_t ram_addr, Error **errp)
{ {
bool all_device_dirty_tracking = bool all_device_dirty_tracking =
@ -275,7 +275,8 @@ int vfio_get_dirty_bitmap(const VFIOContainerBase *bcontainer, uint64_t iova,
dirty_pages = cpu_physical_memory_set_dirty_lebitmap(vbmap.bitmap, ram_addr, dirty_pages = cpu_physical_memory_set_dirty_lebitmap(vbmap.bitmap, ram_addr,
vbmap.pages); vbmap.pages);
trace_vfio_get_dirty_bitmap(iova, size, vbmap.size, ram_addr, dirty_pages); trace_vfio_container_query_dirty_bitmap(iova, size, vbmap.size, ram_addr,
dirty_pages);
out: out:
g_free(vbmap.bitmap); g_free(vbmap.bitmap);

View file

@ -169,7 +169,7 @@ static int vfio_legacy_dma_unmap(const VFIOContainerBase *bcontainer,
} }
if (need_dirty_sync) { if (need_dirty_sync) {
ret = vfio_get_dirty_bitmap(bcontainer, iova, size, ret = vfio_container_query_dirty_bitmap(bcontainer, iova, size,
iotlb->translated_addr, &local_err); iotlb->translated_addr, &local_err);
if (ret) { if (ret) {
error_report_err(local_err); error_report_err(local_err);

View file

@ -109,7 +109,7 @@ vfio_legacy_dma_unmap_overflow_workaround(void) ""
vfio_iommu_map_dirty_notify(uint64_t iova_start, uint64_t iova_end) "iommu dirty @ 0x%"PRIx64" - 0x%"PRIx64 vfio_iommu_map_dirty_notify(uint64_t iova_start, uint64_t iova_end) "iommu dirty @ 0x%"PRIx64" - 0x%"PRIx64
# container-base.c # container-base.c
vfio_get_dirty_bitmap(uint64_t iova, uint64_t size, uint64_t bitmap_size, uint64_t start, uint64_t dirty_pages) "iova=0x%"PRIx64" size= 0x%"PRIx64" bitmap_size=0x%"PRIx64" start=0x%"PRIx64" dirty_pages=%"PRIu64 vfio_container_query_dirty_bitmap(uint64_t iova, uint64_t size, uint64_t bitmap_size, uint64_t start, uint64_t dirty_pages) "iova=0x%"PRIx64" size= 0x%"PRIx64" bitmap_size=0x%"PRIx64" start=0x%"PRIx64" dirty_pages=%"PRIu64
# region.c # region.c
vfio_region_write(const char *name, int index, uint64_t addr, uint64_t data, unsigned size) " (%s:region%d+0x%"PRIx64", 0x%"PRIx64 ", %d)" vfio_region_write(const char *name, int index, uint64_t addr, uint64_t data, unsigned size) " (%s:region%d+0x%"PRIx64", 0x%"PRIx64 ", %d)"

View file

@ -93,8 +93,8 @@ bool vfio_container_dirty_tracking_is_started(
const VFIOContainerBase *bcontainer); const VFIOContainerBase *bcontainer);
bool vfio_container_devices_dirty_tracking_is_supported( bool vfio_container_devices_dirty_tracking_is_supported(
const VFIOContainerBase *bcontainer); const VFIOContainerBase *bcontainer);
int vfio_get_dirty_bitmap(const VFIOContainerBase *bcontainer, uint64_t iova, int vfio_container_query_dirty_bitmap(const VFIOContainerBase *bcontainer,
uint64_t size, ram_addr_t ram_addr, Error **errp); uint64_t iova, uint64_t size, ram_addr_t ram_addr, Error **errp);
GList *vfio_container_get_iova_ranges(const VFIOContainerBase *bcontainer); GList *vfio_container_get_iova_ranges(const VFIOContainerBase *bcontainer);