diff mbox series

[PULL,v2,10/32] memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled

Message ID 160390325499.12234.15952466871554359833.stgit@gimli.home
State New
Headers show
Series VFIO updates 2020-10-28 (for QEMU 5.2 soft-freeze) | expand

Commit Message

Alex Williamson Oct. 28, 2020, 4:40 p.m. UTC
From: Kirti Wankhede <kwankhede@nvidia.com>

mr->ram_block is NULL when mr->is_iommu is true, then fr.dirty_log_mask
wasn't set correctly due to which memory listener's log_sync doesn't
get called.
This patch returns log_mask with DIRTY_MEMORY_MIGRATION set when
IOMMU is enabled.

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 softmmu/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/softmmu/memory.c b/softmmu/memory.c
index ee4a6bc16859..21d533d8ed84 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -1806,7 +1806,7 @@  bool memory_region_is_ram_device(MemoryRegion *mr)
 uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
 {
     uint8_t mask = mr->dirty_log_mask;
-    if (global_dirty_log && mr->ram_block) {
+    if (global_dirty_log && (mr->ram_block || memory_region_is_iommu(mr))) {
         mask |= (1 << DIRTY_MEMORY_MIGRATION);
     }
     return mask;