Commit 9fa06385f634764203b98c83cc8fd6fbf15331f2

Authored by Jan Kiszka
Committed by Anthony Liguori
1 parent de65fe0f

kvm: Mark full address range dirty on live migration start

As Avi correctly noted, last_ram_offset does not mark the last physical
RAM address the guest may see (due to non-continuous memory regions).
Ensure that we catch them all by marking the full possible address range
dirty.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 2 changed files with 3 additions and 1 deletions
targphys.h
... ... @@ -12,9 +12,11 @@
12 12  
13 13 #if TARGET_PHYS_ADDR_BITS == 32
14 14 typedef uint32_t target_phys_addr_t;
  15 +#define TARGET_PHYS_ADDR_MAX UINT32_MAX
15 16 #define TARGET_FMT_plx "%08x"
16 17 #elif TARGET_PHYS_ADDR_BITS == 64
17 18 typedef uint64_t target_phys_addr_t;
  19 +#define TARGET_PHYS_ADDR_MAX UINT64_MAX
18 20 #define TARGET_FMT_plx "%016" PRIx64
19 21 #endif
20 22 #endif
... ...
... ... @@ -3231,7 +3231,7 @@ static int ram_save_live(QEMUFile *f, int stage, void *opaque)
3231 3231 {
3232 3232 ram_addr_t addr;
3233 3233  
3234   - if (cpu_physical_sync_dirty_bitmap(0, last_ram_offset) != 0) {
  3234 + if (cpu_physical_sync_dirty_bitmap(0, TARGET_PHYS_ADDR_MAX) != 0) {
3235 3235 qemu_file_set_error(f);
3236 3236 return 0;
3237 3237 }
... ...