memory: replace cpu_physical_memory_reset_dirty() with test-and-clear
commit03eebc9e3246b9b3f5925aa41f7dfd7c1e467875
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 2 Dec 2014 11:23:18 +0000 (2 11:23 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Jun 2015 15:10:00 +0000 (5 17:10 +0200)
tree74641e34056f1169770c48aa604477315210d6be
parent20015f72bda7d2f356c43580a5542a659afedf83
memory: replace cpu_physical_memory_reset_dirty() with test-and-clear

The cpu_physical_memory_reset_dirty() function is sometimes used
together with cpu_physical_memory_get_dirty().  This is not atomic since
two separate accesses to the dirty memory bitmap are made.

Turn cpu_physical_memory_reset_dirty() and
cpu_physical_memory_clear_dirty_range_type() into the atomic
cpu_physical_memory_test_and_clear_dirty().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <1417519399-3166-6-git-send-email-stefanha@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cputlb.c
exec.c
include/exec/ram_addr.h
memory.c