cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 370fe54037a8d715db78f35d1853dbecdbcef3a0 Mon Sep 17 00:00:00 2001
9ae3a8
From: Juan Quintela <quintela@redhat.com>
9ae3a8
Date: Tue, 14 Jan 2014 15:07:21 +0100
9ae3a8
Subject: [PATCH 10/40] memory: set single dirty flags when possible
9ae3a8
9ae3a8
RH-Author: Juan Quintela <quintela@redhat.com>
9ae3a8
Message-id: <1389712071-23303-11-git-send-email-quintela@redhat.com>
9ae3a8
Patchwork-id: 56661
9ae3a8
O-Subject: [RHEL7 qemu-kvm PATCH 10/40] memory: set single dirty flags when possible
9ae3a8
Bugzilla: 997559
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
9ae3a8
9ae3a8
Signed-off-by: Juan Quintela <quintela@redhat.com>
9ae3a8
Reviewed-by: Eric Blake <eblake@redhat.com>
9ae3a8
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
(cherry picked from commit 63995cebfaa283586682ea6236c9686b2a49ece7)
9ae3a8
Signed-off-by: Juan Quintela <quintela@trasno.org>
9ae3a8
---
9ae3a8
 exec.c                         | 7 ++++---
9ae3a8
 include/exec/memory-internal.h | 4 +++-
9ae3a8
 2 files changed, 7 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 exec.c                         |    7 ++++---
9ae3a8
 include/exec/memory-internal.h |    4 +++-
9ae3a8
 2 files changed, 7 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
diff --git a/exec.c b/exec.c
9ae3a8
index ea81329..178ed4a 100644
9ae3a8
--- a/exec.c
9ae3a8
+++ b/exec.c
9ae3a8
@@ -1919,7 +1919,8 @@ static void invalidate_and_set_dirty(hwaddr addr,
9ae3a8
         /* invalidate code */
9ae3a8
         tb_invalidate_phys_page_range(addr, addr + length, 0);
9ae3a8
         /* set dirty bit */
9ae3a8
-        cpu_physical_memory_set_dirty_flags(addr, (0xff & ~CODE_DIRTY_FLAG));
9ae3a8
+        cpu_physical_memory_set_dirty_flag(addr, VGA_DIRTY_FLAG);
9ae3a8
+        cpu_physical_memory_set_dirty_flag(addr, MIGRATION_DIRTY_FLAG);
9ae3a8
     }
9ae3a8
     xen_modified_memory(addr, length);
9ae3a8
 }
9ae3a8
@@ -2434,8 +2435,8 @@ void stl_phys_notdirty(hwaddr addr, uint32_t val)
9ae3a8
                 /* invalidate code */
9ae3a8
                 tb_invalidate_phys_page_range(addr1, addr1 + 4, 0);
9ae3a8
                 /* set dirty bit */
9ae3a8
-                cpu_physical_memory_set_dirty_flags(
9ae3a8
-                    addr1, (0xff & ~CODE_DIRTY_FLAG));
9ae3a8
+                cpu_physical_memory_set_dirty_flag(addr1, MIGRATION_DIRTY_FLAG);
9ae3a8
+                cpu_physical_memory_set_dirty_flag(addr1, VGA_DIRTY_FLAG);
9ae3a8
             }
9ae3a8
         }
9ae3a8
     }
9ae3a8
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
9ae3a8
index 571a5ef..55b4022 100644
9ae3a8
--- a/include/exec/memory-internal.h
9ae3a8
+++ b/include/exec/memory-internal.h
9ae3a8
@@ -98,7 +98,9 @@ static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
9ae3a8
 
9ae3a8
 static inline void cpu_physical_memory_set_dirty(ram_addr_t addr)
9ae3a8
 {
9ae3a8
-    cpu_physical_memory_set_dirty_flags(addr, 0xff);
9ae3a8
+    cpu_physical_memory_set_dirty_flag(addr, MIGRATION_DIRTY_FLAG);
9ae3a8
+    cpu_physical_memory_set_dirty_flag(addr, VGA_DIRTY_FLAG);
9ae3a8
+    cpu_physical_memory_set_dirty_flag(addr, CODE_DIRTY_FLAG);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static inline int cpu_physical_memory_clear_dirty_flags(ram_addr_t addr,
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8