qemu-e2k/include/exec
Paolo Bonzini 6886867e98 exec: fix migration with devices that use address_space_rw
Devices that use address_space_rw to write large areas to memory
(as opposed to address_space_map/unmap) were broken with respect
to migration since fe680d0 (exec: Limit translation limiting in
address_space_translate to xen, 2014-05-07).  Such devices include
IDE CD-ROMs.

The reason is that invalidate_and_set_dirty (called by address_space_rw
but not address_space_map/unmap) was only setting the dirty bit for
the first page in the translation.

To fix this, introduce cpu_physical_memory_set_dirty_range_nocode that
is the same as cpu_physical_memory_set_dirty_range except it does not
muck with the DIRTY_MEMORY_CODE bitmap.  This function can be used if
the caller invalidates translations with tb_invalidate_phys_page_range.

There is another difference between cpu_physical_memory_set_dirty_range
and cpu_physical_memory_set_dirty_flag; the former includes a call
to xen_modified_memory.  This is handled separately in
invalidate_and_set_dirty, and is not needed in other callers of
cpu_physical_memory_set_dirty_range_nocode, so leave it alone.

Just one nit: now that invalidate_and_set_dirty takes care of handling
multiple pages, there is no need for address_space_unmap to wrap it
in a loop.  In fact that loop would now be O(n^2).

Reported-by: Dave Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-07-22 10:38:50 +02:00
..
user abitypes.h: Remove incorrect ARM ABI_LLONG_ALIGNMENT 2013-09-10 19:09:33 +01:00
address-spaces.h exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
cpu-all.h memory: move RAM_PREALLOC_MASK to exec.c, rename 2014-06-19 18:44:19 +03:00
cpu-common.h NUMA: move numa related code to new file numa.c 2014-06-19 18:44:18 +03:00
cpu-defs.h cpu: Move breakpoints field from CPU_COMMON to CPUState 2014-03-13 19:20:47 +01:00
cpu_ldst.h softmmu: move all load/store functions to cpu_ldst.h 2014-06-05 16:10:33 +02:00
cpu_ldst_template.h softmmu: move all load/store functions to cpu_ldst.h 2014-06-05 16:10:33 +02:00
cputlb.h exec: Change memory_region_section_get_iotlb() argument to CPUState 2014-03-13 19:20:48 +01:00
exec-all.h tcg-ppc: Use uintptr_t in ppc_tb_set_jmp_target 2014-06-23 07:29:30 -07:00
gdbstub.h cpu: Introduce CPUClass::gdb_{read,write}_register() 2013-07-27 00:04:17 +02:00
gen-icount.h cpu: Move icount_decr field from CPU_COMMON to CPUState 2014-03-13 19:20:46 +01:00
helper-gen.h tcg: Move size effects out of dh_arg 2014-05-28 09:33:55 -07:00
helper-head.h tcg: Move size effects out of dh_arg 2014-05-28 09:33:55 -07:00
helper-proto.h tcg: Push tcg-runtime routines into exec/helper-* 2014-05-28 09:33:54 -07:00
helper-tcg.h tcg: Save flags and computed sizemask in TCGHelperInfo 2014-05-28 09:33:54 -07:00
hwaddr.h hwaddr: Make hwaddr type usable beyond softmmu 2013-06-28 13:25:13 +02:00
ioport.h portio: Allow to mark portio lists as coalesced MMIO flushing 2013-10-17 17:24:15 +02:00
memory-internal.h memory: split cpu_physical_memory_* functions to its own include 2014-01-13 14:04:54 +01:00
memory.h memory: MemoryRegion: Add may-overlap and priority props 2014-07-01 10:20:41 +02:00
poison.h exec: Remove env from list of poisoned names 2013-07-27 11:22:54 +04:00
ram_addr.h exec: fix migration with devices that use address_space_rw 2014-07-22 10:38:50 +02:00
softmmu-semi.h exec: Change cpu_memory_rw_debug() argument to CPUState 2013-07-23 02:41:33 +02:00
spinlock.h exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00