aboutsummaryrefslogtreecommitdiff
path: root/lib/dma.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2022-05-27 17:29:32 +0100
committerGitHub <noreply@github.com>2022-05-27 17:29:32 +0100
commit538d6063c9f8d395e1d38285ddfe405c3fcd7619 (patch)
tree96afbcf64f70916966744d3422a113b81e1c21ba /lib/dma.c
parent065c33e7dc7bbd1d5964a5a3af173a69ad3ee931 (diff)
downloadlibvfio-user-538d6063c9f8d395e1d38285ddfe405c3fcd7619.zip
libvfio-user-538d6063c9f8d395e1d38285ddfe405c3fcd7619.tar.gz
libvfio-user-538d6063c9f8d395e1d38285ddfe405c3fcd7619.tar.bz2
remove maps list from DMA controller (#674)
->maps existed so that if a consumer does vfu_map_sg() and then we are asked to enable dirty page tracking, we won't mark those pages as dirty, and will hence potentially lose data. Now that we require quiesce and the use of either vfu_unmap_sg() or vfu_sg_mark_dirty(), there's no need to have this list any more. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.c')
-rw-r--r--lib/dma.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/dma.c b/lib/dma.c
index 2719639..daa1b58 100644
--- a/lib/dma.c
+++ b/lib/dma.c
@@ -99,7 +99,6 @@ dma_controller_create(vfu_ctx_t *vfu_ctx, size_t max_regions, size_t max_size)
dma->nregions = 0;
memset(dma->regions, 0, max_regions * sizeof(dma->regions[0]));
dma->dirty_pgsize = 0;
- LIST_INIT(&dma->maps);
return dma;
}
@@ -468,22 +467,6 @@ out:
return cnt;
}
-static void
-dma_mark_dirty_sgs(dma_controller_t *dma)
-{
- struct dma_sg *sg;
-
- if (dma->dirty_pgsize == 0) {
- return;
- }
-
- LIST_FOREACH(sg, &dma->maps, entry) {
- if (sg->writeable) {
- _dma_mark_dirty(dma, &dma->regions[sg->region], sg);
- }
- }
-}
-
int
dma_controller_dirty_page_logging_start(dma_controller_t *dma, size_t pgsize)
{
@@ -523,8 +506,6 @@ dma_controller_dirty_page_logging_start(dma_controller_t *dma, size_t pgsize)
}
dma->dirty_pgsize = pgsize;
- dma_mark_dirty_sgs(dma);
-
vfu_log(dma->vfu_ctx, LOG_DEBUG, "dirty pages: started logging");
return 0;
@@ -628,8 +609,6 @@ dma_controller_dirty_page_get(dma_controller_t *dma, vfu_dma_addr_t addr,
#endif
memset(region->dirty_bitmap, 0, size);
- dma_mark_dirty_sgs(dma);
-
return 0;
}