thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
9ae3a8
From be5e59136ca2d08576c189ae008e0ae806065e62 Mon Sep 17 00:00:00 2001
9ae3a8
Message-Id: <be5e59136ca2d08576c189ae008e0ae806065e62.1387298827.git.minovotn@redhat.com>
9ae3a8
In-Reply-To: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
9ae3a8
References: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
9ae3a8
From: "Michael S. Tsirkin" <mst@redhat.com>
9ae3a8
Date: Tue, 17 Dec 2013 15:17:16 +0100
9ae3a8
Subject: [PATCH 11/56] arch_init: align MR size to target page size
9ae3a8
9ae3a8
RH-Author: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Message-id: <1387293161-4085-12-git-send-email-mst@redhat.com>
9ae3a8
Patchwork-id: 56316
9ae3a8
O-Subject: [PATCH qemu-kvm RHEL7.0 v2 11/57] arch_init: align MR size to target page size
9ae3a8
Bugzilla: 1034876
9ae3a8
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
9ae3a8
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
Migration code assumes that each MR is a multiple of TARGET_PAGE_SIZE:
9ae3a8
MR size is divided by TARGET_PAGE_SIZE, so if it isn't migration
9ae3a8
never completes.
9ae3a8
But this isn't really required for regions set up with
9ae3a8
memory_region_init_ram, since that calls qemu_ram_alloc
9ae3a8
which aligns size up using TARGET_PAGE_ALIGN.
9ae3a8
9ae3a8
Align MR size up to full target page sizes, this way
9ae3a8
migration completes even if we create a RAM MR
9ae3a8
which is not a full target page size.
9ae3a8
9ae3a8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
(cherry picked from commit 0851c9f75ccb0baf28f5bf901b9ffe3c91fcf969)
9ae3a8
---
9ae3a8
 arch_init.c | 3 ++-
9ae3a8
 1 file changed, 2 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
Signed-off-by: Michal Novotny <minovotn@redhat.com>
9ae3a8
---
9ae3a8
 arch_init.c | 3 ++-
9ae3a8
 1 file changed, 2 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/arch_init.c b/arch_init.c
9ae3a8
index 5301cfd..2c0ea1b 100644
9ae3a8
--- a/arch_init.c
9ae3a8
+++ b/arch_init.c
9ae3a8
@@ -341,7 +341,8 @@ ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
9ae3a8
 {
9ae3a8
     unsigned long base = mr->ram_addr >> TARGET_PAGE_BITS;
9ae3a8
     unsigned long nr = base + (start >> TARGET_PAGE_BITS);
9ae3a8
-    unsigned long size = base + (int128_get64(mr->size) >> TARGET_PAGE_BITS);
9ae3a8
+    uint64_t mr_size = TARGET_PAGE_ALIGN(memory_region_size(mr));
9ae3a8
+    unsigned long size = base + (mr_size >> TARGET_PAGE_BITS);
9ae3a8
 
9ae3a8
     unsigned long next;
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.7.11.7
9ae3a8