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
address-spaces.h
cpu_ldst_template.h softmmu: move all load/store functions to cpu_ldst.h 2014-06-05 16:10:33 +02:00
cpu_ldst.h softmmu: move all load/store functions to cpu_ldst.h 2014-06-05 16:10:33 +02: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
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
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
ioport.h
memory-internal.h
memory.h memory: MemoryRegion: Add may-overlap and priority props 2014-07-01 10:20:41 +02:00
poison.h
ram_addr.h exec: fix migration with devices that use address_space_rw 2014-07-22 10:38:50 +02:00
softmmu-semi.h
spinlock.h