Blame SOURCES/kvm-use-directly-cpu_physical_memory_-api-for-tracki.patch

0a122b
From 85f240605d1a46de1fc8609f8e64b994f4716adb Mon Sep 17 00:00:00 2001
0a122b
From: Juan Quintela <quintela@redhat.com>
0a122b
Date: Tue, 14 Jan 2014 15:07:46 +0100
0a122b
Subject: [PATCH 35/40] kvm: use directly cpu_physical_memory_* api for tracking dirty pages
0a122b
MIME-Version: 1.0
0a122b
Content-Type: text/plain; charset=UTF-8
0a122b
Content-Transfer-Encoding: 8bit
0a122b
0a122b
RH-Author: Juan Quintela <quintela@redhat.com>
0a122b
Message-id: <1389712071-23303-36-git-send-email-quintela@redhat.com>
0a122b
Patchwork-id: 56690
0a122b
O-Subject: [RHEL7 qemu-kvm PATCH 35/40] kvm: use directly cpu_physical_memory_* api for tracking dirty pages
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
Performance is important in this function, and we want to optimize even further.
0a122b
0a122b
Signed-off-by: Juan Quintela <quintela@redhat.com>
0a122b
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
0a122b
(cherry picked from commit 747afd5bcdc90f608c75d95f8a629a9cfc838c57)
0a122b
0a122b
Conflicts:
0a122b
	kvm-all.c
0a122b
0a122b
Due to upstream commits:
0a122b
0a122b
commit dd1750d7981cf9e38985c9dfa474dcdbbe236270
0a122b
Author: Andreas Färber <afaerber@suse.de>
0a122b
Date:   Wed May 1 13:45:44 2013 +0200
0a122b
0a122b
    kvm: Change kvm_cpu_synchronize_state() argument to CPUState
0a122b
0a122b
Signed-off-by: Juan Quintela <quintela@trasno.org>
0a122b
---
0a122b
 kvm-all.c | 7 +++++--
0a122b
 1 file changed, 5 insertions(+), 2 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 kvm-all.c |    7 +++++--
0a122b
 1 files changed, 5 insertions(+), 2 deletions(-)
0a122b
0a122b
diff --git a/kvm-all.c b/kvm-all.c
0a122b
index 0e21494..8e2bd34 100644
0a122b
--- a/kvm-all.c
0a122b
+++ b/kvm-all.c
0a122b
@@ -31,6 +31,7 @@
0a122b
 #include "sysemu/kvm.h"
0a122b
 #include "qemu/bswap.h"
0a122b
 #include "exec/memory.h"
0a122b
+#include "exec/ram_addr.h"
0a122b
 #include "exec/address-spaces.h"
0a122b
 #include "qemu/event_notifier.h"
0a122b
 #include "trace.h"
0a122b
@@ -367,6 +368,7 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
0a122b
     unsigned int i, j;
0a122b
     unsigned long page_number, c;
0a122b
     hwaddr addr, addr1;
0a122b
+    ram_addr_t ram_addr;
0a122b
     unsigned int len = ((section->size / getpagesize()) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
0a122b
     unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE;
0a122b
 
0a122b
@@ -383,8 +385,9 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
0a122b
                 page_number = (i * HOST_LONG_BITS + j) * hpratio;
0a122b
                 addr1 = page_number * TARGET_PAGE_SIZE;
0a122b
                 addr = section->offset_within_region + addr1;
0a122b
-                memory_region_set_dirty(section->mr, addr,
0a122b
-                                        TARGET_PAGE_SIZE * hpratio);
0a122b
+                ram_addr = section->mr->ram_addr + addr;
0a122b
+                cpu_physical_memory_set_dirty_range(ram_addr,
0a122b
+                                                    TARGET_PAGE_SIZE * hpratio);
0a122b
             } while (c != 0);
0a122b
         }
0a122b
     }
0a122b
-- 
0a122b
1.7.1
0a122b