Message ID | fd18627a-e012-1af8-9d9f-9ae8a1415258@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [RFC] vfio-pci/migration: Dirty logging of the Memory BAR region? | expand |
On 15/11/20 15:31, Zenghui Yu wrote: > diff --git a/softmmu/memory.c b/softmmu/memory.c > index 71951fe4dc..0958db1a08 100644 > --- a/softmmu/memory.c > +++ b/softmmu/memory.c > @@ -1806,7 +1806,10 @@ 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 || > memory_region_is_iommu(mr))) { > + RAMBlock *rb = mr->ram_block; > + > + if (global_dirty_log && ((rb && qemu_ram_is_migratable(rb)) || > + memory_region_is_iommu(mr))) { > mask |= (1 << DIRTY_MEMORY_MIGRATION); > } > return mask; Yes, this makes sense. Please send it as a patch, thanks! Paolo
On 2020/11/15 23:03, Paolo Bonzini wrote: > On 15/11/20 15:31, Zenghui Yu wrote: >> diff --git a/softmmu/memory.c b/softmmu/memory.c >> index 71951fe4dc..0958db1a08 100644 >> --- a/softmmu/memory.c >> +++ b/softmmu/memory.c >> @@ -1806,7 +1806,10 @@ 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 || >> memory_region_is_iommu(mr))) { >> + RAMBlock *rb = mr->ram_block; >> + >> + if (global_dirty_log && ((rb && qemu_ram_is_migratable(rb)) || >> + memory_region_is_iommu(mr))) { >> mask |= (1 << DIRTY_MEMORY_MIGRATION); >> } >> return mask; > > Yes, this makes sense. Please send it as a patch, thanks! Sure, I'm going to write a commit message for it. Thanks for your review. Zenghui
diff --git a/softmmu/memory.c b/softmmu/memory.c index 71951fe4dc..0958db1a08 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -1806,7 +1806,10 @@ 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 || memory_region_is_iommu(mr))) { + RAMBlock *rb = mr->ram_block; + + if (global_dirty_log && ((rb && qemu_ram_is_migratable(rb)) || + memory_region_is_iommu(mr))) { mask |= (1 << DIRTY_MEMORY_MIGRATION); }