提交 9460dee4 编写于 作者: P Paolo Bonzini

memory: do not touch code dirty bitmap unless TCG is enabled

cpu_physical_memory_set_dirty_lebitmap unconditionally syncs the
DIRTY_MEMORY_CODE bitmap.  This however is unused unless TCG is
enabled.
Reviewed-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 e87f7778
...@@ -162,11 +162,14 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, ...@@ -162,11 +162,14 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap,
ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION][page + k] |= temp; ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION][page + k] |= temp;
ram_list.dirty_memory[DIRTY_MEMORY_VGA][page + k] |= temp; ram_list.dirty_memory[DIRTY_MEMORY_VGA][page + k] |= temp;
ram_list.dirty_memory[DIRTY_MEMORY_CODE][page + k] |= temp; if (tcg_enabled()) {
ram_list.dirty_memory[DIRTY_MEMORY_CODE][page + k] |= temp;
}
} }
} }
xen_modified_memory(start, pages << TARGET_PAGE_BITS); xen_modified_memory(start, pages << TARGET_PAGE_BITS);
} else { } else {
uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE;
/* /*
* bitmap-traveling is faster than memory-traveling (for addr...) * bitmap-traveling is faster than memory-traveling (for addr...)
* especially when most of the memory is not dirty. * especially when most of the memory is not dirty.
...@@ -181,8 +184,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, ...@@ -181,8 +184,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap,
addr = page_number * TARGET_PAGE_SIZE; addr = page_number * TARGET_PAGE_SIZE;
ram_addr = start + addr; ram_addr = start + addr;
cpu_physical_memory_set_dirty_range(ram_addr, cpu_physical_memory_set_dirty_range(ram_addr,
TARGET_PAGE_SIZE * hpratio, TARGET_PAGE_SIZE * hpratio, clients);
DIRTY_CLIENTS_ALL);
} while (c != 0); } while (c != 0);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册