qemu-e2k/include/exec
Paolo Bonzini 9458a9a1df memory: fix race between TCG and accesses to dirty bitmap
There is a race between TCG and accesses to the dirty log:

      vCPU thread                  reader thread
      -----------------------      -----------------------
      TLB check -> slow path
        notdirty_mem_write
          write to RAM
          set dirty flag
                                   clear dirty flag
      TLB check -> fast path
                                   read memory
        write to RAM

Fortunately, in order to fix it, no change is required to the
vCPU thread.  However, the reader thread must delay the read after
the vCPU thread has finished the write.  This can be approximated
conservatively by run_on_cpu, which waits for the end of the current
translation block.

A similar technique is used by KVM, which has to do a synchronous TLB
flush after doing a test-and-clear of the dirty-page flags.

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-08-20 17:26:20 +02:00
..
user include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
address-spaces.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
cpu-all.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
cpu-common.h Header cleanups 2019-05-03 13:03:04 +02:00
cpu-defs.h Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
cpu_ldst.h linux-user: check valid address in access_ok() 2019-07-18 13:57:28 +02:00
cpu_ldst_template.h cpu: Replace ENV_GET_CPU with env_cpu 2019-06-10 07:03:34 -07:00
cpu_ldst_useronly_template.h tcg: Release mmap_lock on translation fault 2019-07-14 12:19:01 +02:00
cputlb.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
exec-all.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
gdbstub.h gdbstub: Clarify what gdb_handlesig() is doing 2018-05-25 10:10:55 +02:00
gen-icount.h cpu: Move icount_decr to CPUNegativeOffsetState 2019-06-10 07:03:42 -07:00
helper-gen.h tcg: Allow 6 arguments to TCG helpers 2017-12-29 12:43:40 -08:00
helper-head.h include/exec/helper-head.h: support "const void *" in helper calls 2019-02-21 10:22:24 -08:00
helper-proto.h tcg: Allow 6 arguments to TCG helpers 2017-12-29 12:43:40 -08:00
helper-tcg.h tcg: Add TCG_CALL_NO_RETURN 2018-12-26 06:40:24 +11:00
hwaddr.h hw: Clean up includes 2016-06-07 18:19:23 +03:00
ioport.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
log.h qom/cpu: Simplify how CPUClass:cpu_dump_state() prints 2019-04-18 22:18:59 +02:00
memattrs.h exec: Add target-specific tlb bits to MemTxAttrs 2019-02-05 16:52:37 +00:00
memory-internal.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
memory.h memory: fix race between TCG and accesses to dirty bitmap 2019-08-20 17:26:20 +02:00
memory_ldst.inc.h exec: move memory access declarations to a common header, inline *_phys functions 2018-05-09 00:13:38 +02:00
memory_ldst_cached.inc.h exec: reintroduce MemoryRegion caching 2018-05-09 00:13:38 +02:00
memory_ldst_phys.inc.h exec: move memory access declarations to a common header, inline *_phys functions 2018-05-09 00:13:38 +02:00
poison.h configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00
ram_addr.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
ramlist.h migration: Poison ramblock loops in migration 2018-06-15 14:40:56 +01:00
softmmu-semi.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
target_page.h migration: Make savevm.c target independent 2017-05-18 19:21:00 +02:00
tb-context.h tcg: remove tb_lock 2018-06-15 08:18:48 -10:00
tb-hash.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
tb-lookup.h accel/tcg: Consider cluster index in tb_lookup__cpu_state() 2019-02-06 03:39:24 +00:00
translator.h Clean up decorations and whitespace around header guards 2019-05-13 08:58:55 +02:00