[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/14] arch_init: align MR size to target page size
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 02/14] arch_init: align MR size to target page size |
Date: |
Mon, 26 Aug 2013 19:43:05 +0300 |
Migration code assumes that each MR is a multiple of TARGET_PAGE_SIZE:
MR size is divided by TARGET_PAGE_SIZE, so if it isn't migration
never completes.
But this isn't really required for regions set up with
memory_region_init_ram, since that calls qemu_ram_alloc
which aligns size up using TARGET_PAGE_ALIGN.
Align MR size up to full target page sizes, this way
migration completes even if we create a RAM MR
which is not a full target page size.
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
---
arch_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch_init.c b/arch_init.c
index 68a7ab7..ac8eb59 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -342,7 +342,8 @@ ram_addr_t
migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
{
unsigned long base = mr->ram_addr >> TARGET_PAGE_BITS;
unsigned long nr = base + (start >> TARGET_PAGE_BITS);
- unsigned long size = base + (int128_get64(mr->size) >> TARGET_PAGE_BITS);
+ uint64_t mr_size = TARGET_PAGE_ALIGN(memory_region_size(mr));
+ unsigned long size = base + (mr_size >> TARGET_PAGE_BITS);
unsigned long next;
--
MST
- [Qemu-devel] [PULL 00/14] pc,pci,virtio fixes and cleanups, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 01/14] pc: cleanup 1.4 compat support, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 02/14] arch_init: align MR size to target page size,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 03/14] loader: store FW CFG ROM files in RAM, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 04/14] q35: Add PCIe switch to example q35 configuration, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 05/14] sun4: Don't prematurely explode QEMUMachineInitArgs, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 06/14] ppc: Don't explode QEMUMachineInitArgs into local variables needlessly, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 07/14] ppc: Don't duplicate QEMUMachineInitArgs in PPCE500Params, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 08/14] pc: Don't prematurely explode QEMUMachineInitArgs, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 09/14] pc: Don't explode QEMUMachineInitArgs into local variables needlessly, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 10/14] pc: Kill pc_init_pci_1_0(), Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 11/14] pc: Create pc_compat_*() functions, Michael S. Tsirkin, 2013/08/26
- [Qemu-devel] [PULL 12/14] pc: pc_compat_1_4() now can call pc_compat_1_5(), Michael S. Tsirkin, 2013/08/26