[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 33/49] memory: make cpu_physical_memory_get_dirty()
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 33/49] memory: make cpu_physical_memory_get_dirty() the main function |
Date: |
Mon, 13 Jan 2014 18:40:18 +0100 |
And make cpu_physical_memory_get_dirty_flag() to use it. It used to
be the other way around.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Orit Wasserman <address@hidden>
---
include/exec/memory-internal.h | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index b99617a..edca8a8 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -40,11 +40,28 @@ void *qemu_get_ram_ptr(ram_addr_t addr);
void qemu_ram_free(ram_addr_t addr);
void qemu_ram_free_from_ptr(ram_addr_t addr);
+static inline int cpu_physical_memory_get_dirty(ram_addr_t start,
+ ram_addr_t length,
+ unsigned client)
+{
+ int ret = 0;
+ ram_addr_t addr, end;
+
+ assert(client < DIRTY_MEMORY_NUM);
+
+ end = TARGET_PAGE_ALIGN(start + length);
+ start &= TARGET_PAGE_MASK;
+ for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
+ ret |= test_bit(addr >> TARGET_PAGE_BITS,
+ ram_list.dirty_memory[client]);
+ }
+ return ret;
+}
+
static inline bool cpu_physical_memory_get_dirty_flag(ram_addr_t addr,
unsigned client)
{
- assert(client < DIRTY_MEMORY_NUM);
- return test_bit(addr >> TARGET_PAGE_BITS, ram_list.dirty_memory[client]);
+ return cpu_physical_memory_get_dirty(addr, 1, client);
}
/* read dirty bit (return 0 or 1) */
@@ -57,21 +74,6 @@ static inline bool cpu_physical_memory_is_dirty(ram_addr_t
addr)
return vga && code && migration;
}
-static inline int cpu_physical_memory_get_dirty(ram_addr_t start,
- ram_addr_t length,
- unsigned client)
-{
- int ret = 0;
- ram_addr_t addr, end;
-
- end = TARGET_PAGE_ALIGN(start + length);
- start &= TARGET_PAGE_MASK;
- for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
- ret |= cpu_physical_memory_get_dirty_flag(addr, client);
- }
- return ret;
-}
-
static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
unsigned client)
{
--
1.8.4.2
- [Qemu-devel] [PATCH 19/49] memory: make cpu_physical_memory_is_dirty return bool, (continued)
- [Qemu-devel] [PATCH 19/49] memory: make cpu_physical_memory_is_dirty return bool, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 23/49] memory: cpu_physical_memory_mask_dirty_range() always clears a single flag, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 24/49] memory: use bit 2 for migration, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 25/49] memory: make sure that client is always inside range, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 26/49] memory: only resize dirty bitmap when memory size increases, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 27/49] memory: cpu_physical_memory_clear_dirty_flag() result is never used, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 28/49] bitmap: Add bitmap_zero_extend operation, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 30/49] memory: unfold cpu_physical_memory_clear_dirty_flag() in its only user, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 31/49] memory: unfold cpu_physical_memory_set_dirty() in its only user, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 29/49] memory: split dirty bitmap into three, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 33/49] memory: make cpu_physical_memory_get_dirty() the main function,
Juan Quintela <=
- [Qemu-devel] [PATCH 32/49] memory: unfold cpu_physical_memory_set_dirty_flag(), Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 35/49] memory: s/mask/clear/ cpu_physical_memory_mask_dirty_range, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 34/49] memory: cpu_physical_memory_get_dirty() is used as returning a bool, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 36/49] memory: use find_next_bit() to find dirty bits, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 38/49] memory: cpu_physical_memory_clear_dirty_range() now uses bitmap operations, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 39/49] memory: s/dirty/clean/ in cpu_physical_memory_is_dirty(), Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 37/49] memory: cpu_physical_memory_set_dirty_range() now uses bitmap operations, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 41/49] memory: cpu_physical_memory_set_dirty_tracking() should return void, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 42/49] memory: split cpu_physical_memory_* functions to its own include, Juan Quintela, 2014/01/13
- [Qemu-devel] [PATCH 43/49] memory: unfold memory_region_test_and_clear(), Juan Quintela, 2014/01/13