From: Kirti Wankhede Date: Mon, 26 Oct 2020 09:36:20 +0000 (+0530) Subject: memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled X-Git-Tag: v5.2.0-rc0~10^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74ee653799f93dfb119de9a248bdf0a85a68904f;p=thirdparty%2Fqemu.git memory: Set DIRTY_MEMORY_MIGRATION when IOMMU is enabled 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 Reviewed-by: Yan Zhao Acked-by: Paolo Bonzini Signed-off-by: Alex Williamson --- diff --git a/softmmu/memory.c b/softmmu/memory.c index ee4a6bc1685..21d533d8ed8 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;