0a122b
From 0ef152ec4827c61924b0e05d32e4ba44a8aa996f Mon Sep 17 00:00:00 2001
0a122b
From: Juan Quintela <quintela@redhat.com>
0a122b
Date: Tue, 14 Jan 2014 15:07:22 +0100
0a122b
Subject: [PATCH 11/40] memory: cpu_physical_memory_set_dirty_range() always dirty all flags
0a122b
0a122b
RH-Author: Juan Quintela <quintela@redhat.com>
0a122b
Message-id: <1389712071-23303-12-git-send-email-quintela@redhat.com>
0a122b
Patchwork-id: 56666
0a122b
O-Subject: [RHEL7 qemu-kvm PATCH 11/40] memory: cpu_physical_memory_set_dirty_range() always dirty all flags
0a122b
Bugzilla: 997559
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
0a122b
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
0a122b
0a122b
So remove the flag argument and do it directly.  After this change,
0a122b
there is nothing else using cpu_physical_memory_set_dirty_flags() so
0a122b
remove it.
0a122b
0a122b
Signed-off-by: Juan Quintela <quintela@redhat.com>
0a122b
Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
0a122b
(cherry picked from commit 75218e7f2b7f052c6f44489afaf45b3ea4369f45)
0a122b
Signed-off-by: Juan Quintela <quintela@trasno.org>
0a122b
---
0a122b
 exec.c                         |  2 +-
0a122b
 include/exec/memory-internal.h | 11 ++---------
0a122b
 memory.c                       |  2 +-
0a122b
 3 files changed, 4 insertions(+), 11 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 exec.c                         |    2 +-
0a122b
 include/exec/memory-internal.h |   11 ++---------
0a122b
 memory.c                       |    2 +-
0a122b
 3 files changed, 4 insertions(+), 11 deletions(-)
0a122b
0a122b
diff --git a/exec.c b/exec.c
0a122b
index 178ed4a..069e082 100644
0a122b
--- a/exec.c
0a122b
+++ b/exec.c
0a122b
@@ -1162,7 +1162,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
0a122b
                                        last_ram_offset() >> TARGET_PAGE_BITS);
0a122b
     memset(ram_list.phys_dirty + (new_block->offset >> TARGET_PAGE_BITS),
0a122b
            0, size >> TARGET_PAGE_BITS);
0a122b
-    cpu_physical_memory_set_dirty_range(new_block->offset, size, 0xff);
0a122b
+    cpu_physical_memory_set_dirty_range(new_block->offset, size);
0a122b
 
0a122b
     qemu_ram_setup_dump(new_block->host, size);
0a122b
     qemu_madvise(new_block->host, size, QEMU_MADV_HUGEPAGE);
0a122b
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
0a122b
index 55b4022..794fabd 100644
0a122b
--- a/include/exec/memory-internal.h
0a122b
+++ b/include/exec/memory-internal.h
0a122b
@@ -84,12 +84,6 @@ static inline int cpu_physical_memory_get_dirty(ram_addr_t start,
0a122b
     return ret;
0a122b
 }
0a122b
 
0a122b
-static inline void cpu_physical_memory_set_dirty_flags(ram_addr_t addr,
0a122b
-                                                      int dirty_flags)
0a122b
-{
0a122b
-    ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags;
0a122b
-}
0a122b
-
0a122b
 static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
0a122b
                                                       int dirty_flag)
0a122b
 {
0a122b
@@ -112,15 +106,14 @@ static inline int cpu_physical_memory_clear_dirty_flags(ram_addr_t addr,
0a122b
 }
0a122b
 
0a122b
 static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
0a122b
-                                                       ram_addr_t length,
0a122b
-                                                       int dirty_flags)
0a122b
+                                                       ram_addr_t length)
0a122b
 {
0a122b
     ram_addr_t addr, end;
0a122b
 
0a122b
     end = TARGET_PAGE_ALIGN(start + length);
0a122b
     start &= TARGET_PAGE_MASK;
0a122b
     for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
0a122b
-        cpu_physical_memory_set_dirty_flags(addr, dirty_flags);
0a122b
+        cpu_physical_memory_set_dirty(addr);
0a122b
     }
0a122b
     xen_modified_memory(addr, length);
0a122b
 }
0a122b
diff --git a/memory.c b/memory.c
0a122b
index fc11859..e7a454f 100644
0a122b
--- a/memory.c
0a122b
+++ b/memory.c
0a122b
@@ -1078,7 +1078,7 @@ void memory_region_set_dirty(MemoryRegion *mr, hwaddr addr,
0a122b
                              hwaddr size)
0a122b
 {
0a122b
     assert(mr->terminates);
0a122b
-    cpu_physical_memory_set_dirty_range(mr->ram_addr + addr, size, -1);
0a122b
+    cpu_physical_memory_set_dirty_range(mr->ram_addr + addr, size);
0a122b
 }
0a122b
 
0a122b
 bool memory_region_test_and_clear_dirty(MemoryRegion *mr, hwaddr addr,
0a122b
-- 
0a122b
1.7.1
0a122b