Generally we want to clarify terminology and avoid confusions, prefering @start with (exclusive) @end, and base @addr with @length (for inclusive range).
Here as cpu_physical_memory_test_and_clear_dirty() operates on a range, rename @start as @addr. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> --- include/system/ram_addr.h | 2 +- system/physmem.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/system/ram_addr.h b/include/system/ram_addr.h index 7197913d761..3899c084076 100644 --- a/include/system/ram_addr.h +++ b/include/system/ram_addr.h @@ -166,7 +166,7 @@ uint64_t cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, void cpu_physical_memory_dirty_bits_cleared(ram_addr_t addr, ram_addr_t length); -bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start, +bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t addr, ram_addr_t length, unsigned client); diff --git a/system/physmem.c b/system/physmem.c index c475ce0a5db..9e36748dc4a 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -1092,7 +1092,7 @@ void cpu_physical_memory_set_dirty_range(ram_addr_t addr, ram_addr_t length, } /* Note: start and end must be within the same ram block. */ -bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start, +bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t addr, ram_addr_t length, unsigned client) { @@ -1106,16 +1106,16 @@ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start, return false; } - end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS; - start_page = start >> TARGET_PAGE_BITS; + end = TARGET_PAGE_ALIGN(addr + length) >> TARGET_PAGE_BITS; + start_page = addr >> TARGET_PAGE_BITS; page = start_page; WITH_RCU_READ_LOCK_GUARD() { blocks = qatomic_rcu_read(&ram_list.dirty_memory[client]); - ramblock = qemu_get_ram_block(start); + ramblock = qemu_get_ram_block(addr); /* Range sanity check on the ramblock */ - assert(start >= ramblock->offset && - start + length <= ramblock->offset + ramblock->used_length); + assert(addr >= ramblock->offset && + addr + length <= ramblock->offset + ramblock->used_length); while (page < end) { unsigned long idx = page / DIRTY_MEMORY_BLOCK_SIZE; @@ -1134,7 +1134,7 @@ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start, } if (dirty) { - cpu_physical_memory_dirty_bits_cleared(start, length); + cpu_physical_memory_dirty_bits_cleared(addr, length); } return dirty; -- 2.51.0
