[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/38] memory: make cpu_physical_memory_is_dirty ret
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 07/38] memory: make cpu_physical_memory_is_dirty return bool |
Date: |
Tue, 17 Dec 2013 16:25:43 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
exec.c | 7 ++-----
include/exec/memory-internal.h | 8 ++++++--
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/exec.c b/exec.c
index 95bcf70..a1fc280 100644
--- a/exec.c
+++ b/exec.c
@@ -1484,11 +1484,8 @@ found:
static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
uint64_t val, unsigned size)
{
- int dirty_flags;
- dirty_flags = cpu_physical_memory_get_dirty_flags(ram_addr);
if (!cpu_physical_memory_get_dirty_flag(ram_addr, CODE_DIRTY_FLAG)) {
tb_invalidate_phys_page_fast(ram_addr, size);
- dirty_flags = cpu_physical_memory_get_dirty_flags(ram_addr);
}
switch (size) {
case 1:
@@ -1503,8 +1500,8 @@ static void notdirty_mem_write(void *opaque, hwaddr
ram_addr,
default:
abort();
}
- dirty_flags |= (0xff & ~CODE_DIRTY_FLAG);
- cpu_physical_memory_set_dirty_flags(ram_addr, dirty_flags);
+ cpu_physical_memory_set_dirty_flag(ram_addr, MIGRATION_DIRTY_FLAG);
+ cpu_physical_memory_set_dirty_flag(ram_addr, VGA_DIRTY_FLAG);
/* we remove the notdirty callback only if the code has been
flushed */
if (cpu_physical_memory_is_dirty(ram_addr)) {
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index 136198c..0b25c3f 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -56,9 +56,13 @@ static inline bool
cpu_physical_memory_get_dirty_flag(ram_addr_t addr,
}
/* read dirty bit (return 0 or 1) */
-static inline int cpu_physical_memory_is_dirty(ram_addr_t addr)
+static inline bool cpu_physical_memory_is_dirty(ram_addr_t addr)
{
- return cpu_physical_memory_get_dirty_flags(addr) == 0xff;
+ bool vga = cpu_physical_memory_get_dirty_flag(addr, VGA_DIRTY_FLAG);
+ bool code = cpu_physical_memory_get_dirty_flag(addr, CODE_DIRTY_FLAG);
+ bool migration =
+ cpu_physical_memory_get_dirty_flag(addr, MIGRATION_DIRTY_FLAG);
+ return vga && code && migration;
}
static inline int cpu_physical_memory_get_dirty(ram_addr_t start,
--
1.8.3.1
- [Qemu-devel] [PATCH v3 00/38] bitmap queue, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 02/38] memory: cpu_physical_memory_set_dirty_flags() result is never used, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 03/38] memory: cpu_physical_memory_set_dirty_range() return void, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 01/38] bitmap: use long as index, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 04/38] exec: use accessor function to know if memory is dirty, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 05/38] memory: create function to set a single dirty bit, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 06/38] exec: create function to get a single dirty bit, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 07/38] memory: make cpu_physical_memory_is_dirty return bool,
Juan Quintela <=
- [Qemu-devel] [PATCH 08/38] memory: all users of cpu_physical_memory_get_dirty used only one flag, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 09/38] memory: set single dirty flags when possible, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 10/38] memory: cpu_physical_memory_set_dirty_range() always dirty all flags, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 12/38] memory: use bit 2 for migration, Juan Quintela, 2013/12/17
- [Qemu-devel] [PATCH 13/38] memory: make sure that client is always inside range, Juan Quintela, 2013/12/17