diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-11-17 17:54:07 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-01-08 13:17:54 +0200 |
commit | c8d6f66ae7d0ce5f3622c19e29a2333d28dc1e9a (patch) | |
tree | 461618ac669ed4d301775dbf48419305815c7790 | |
parent | e7af4c67300b3f9382e96f7a6741a5992116b2d2 (diff) |
exec: cpu_physical_memory_set/clear_dirty_range
Make cpu_physical_memory_set/clear_dirty_range
behave symmetrically.
To clear range for a given client type only, add
cpu_physical_memory_clear_dirty_range_type.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | exec.c | 2 | ||||
-rw-r--r-- | include/exec/ram_addr.h | 15 |
2 files changed, 13 insertions, 4 deletions
@@ -850,7 +850,7 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t length, { if (length == 0) return; - cpu_physical_memory_clear_dirty_range(start, length, client); + cpu_physical_memory_clear_dirty_range_type(start, length, client); if (tcg_enabled()) { tlb_reset_dirty_range_all(start, length); diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 8fc75cdd2b..254931cad4 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -172,9 +172,9 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, } #endif /* not _WIN32 */ -static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start, - ram_addr_t length, - unsigned client) +static inline void cpu_physical_memory_clear_dirty_range_type(ram_addr_t start, + ram_addr_t length, + unsigned client) { unsigned long end, page; @@ -184,6 +184,15 @@ static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start, bitmap_clear(ram_list.dirty_memory[client], page, end - page); } +static inline void cpu_physical_memory_clear_dirty_range(ram_addr_t start, + ram_addr_t length) +{ + cpu_physical_memory_clear_dirty_range_type(start, length, DIRTY_MEMORY_MIGRATION); + cpu_physical_memory_clear_dirty_range_type(start, length, DIRTY_MEMORY_VGA); + cpu_physical_memory_clear_dirty_range_type(start, length, DIRTY_MEMORY_CODE); +} + + void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t length, unsigned client); |