mirror of https://gitee.com/openkylin/qemu.git
memory: optimize memory_global_dirty_log_sync
Only return a nonzero dirty_log_mask for RAM/ROM memory regions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9a54635dcb
commit
adaad61c3c
8
memory.c
8
memory.c
|
@ -1499,7 +1499,7 @@ bool memory_region_is_skip_dump(MemoryRegion *mr)
|
||||||
uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
|
uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
|
||||||
{
|
{
|
||||||
uint8_t mask = mr->dirty_log_mask;
|
uint8_t mask = mr->dirty_log_mask;
|
||||||
if (global_dirty_log) {
|
if (global_dirty_log && mr->ram_block) {
|
||||||
mask |= (1 << DIRTY_MEMORY_MIGRATION);
|
mask |= (1 << DIRTY_MEMORY_MIGRATION);
|
||||||
}
|
}
|
||||||
return mask;
|
return mask;
|
||||||
|
@ -2171,8 +2171,10 @@ void memory_global_dirty_log_sync(void)
|
||||||
as = listener->address_space;
|
as = listener->address_space;
|
||||||
view = address_space_get_flatview(as);
|
view = address_space_get_flatview(as);
|
||||||
FOR_EACH_FLAT_RANGE(fr, view) {
|
FOR_EACH_FLAT_RANGE(fr, view) {
|
||||||
MemoryRegionSection mrs = section_from_flat_range(fr, as);
|
if (fr->dirty_log_mask) {
|
||||||
listener->log_sync(listener, &mrs);
|
MemoryRegionSection mrs = section_from_flat_range(fr, as);
|
||||||
|
listener->log_sync(listener, &mrs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
flatview_unref(view);
|
flatview_unref(view);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue