memory: fix usage of find_next_bit and find_next_zero_bit
commit88c73d16ad1b6c22a2ab082064d0d521f756296a
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Feb 2016 14:11:45 +0000 (10 15:11 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 10 Feb 2016 22:38:24 +0000 (10 22:38 +0000)
tree3e907fb60f9291eb476655ebf1419b138bd4b3d7
parentc9f19dff101e2c2cf3fa3967eceec2833e845e40
memory: fix usage of find_next_bit and find_next_zero_bit

The last two arguments to these functions are the last and first bit to
check relative to the base.  The code was using incorrectly the first
bit and the number of bits.  Fix this in cpu_physical_memory_get_dirty
and cpu_physical_memory_all_dirty.  This requires a few changes in the
iteration; change the code in cpu_physical_memory_set_dirty_range to
match.

Fixes: 5b82b70
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Leon Alrae <leon.alrae@imgtec.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-id: 1455113505-11237-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
include/exec/ram_addr.h