This patch add some calls to xen_modified_memory to notify Xen about dirtybits
during migration.
Backport of
e226939de5814527a21396903b08c3d0ed989558
Note a call to xen_modify_memory has been added to qemu_ram_alloc_from_ptr
as the upstream version does:
cpu_physical_memory_set_dirty_range(new_block->offset, size, 0xff);
and this function does not exist in 4.2.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Alex Bligh <alex@alex.org.uk>
memset(ram_list.phys_dirty + (new_block->offset >> TARGET_PAGE_BITS),
0xff, size >> TARGET_PAGE_BITS);
+ if (xen_enabled())
+ xen_modified_memory(new_block->offset, size);
+
if (kvm_enabled())
kvm_setup_guest_memory(new_block->host, size);
/* set dirty bit */
cpu_physical_memory_set_dirty_flags(addr, (0xff & ~CODE_DIRTY_FLAG));
}
+ xen_modified_memory(addr, length);
}
void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
#include "ioport.h"
#include "bitops.h"
#include "kvm.h"
+#include "hw/xen.h"
#include <assert.h>
unsigned memory_region_transaction_depth = 0;
void memory_region_set_dirty(MemoryRegion *mr, target_phys_addr_t addr)
{
assert(mr->terminates);
+ if (xen_enabled())
+ xen_modified_memory((mr->ram_addr + addr) & TARGET_PAGE_MASK,
+ TARGET_PAGE_SIZE);
return cpu_physical_memory_set_dirty(mr->ram_addr + addr);
}