On Mon, Jan 9, 2012 at 12:11, Avi Kivity <a...@redhat.com> wrote: > On 01/08/2012 11:10 PM, Blue Swirl wrote: >> Instead of each target knowing or guessing the guest page size, >> just pass the desired size of dirtied memory area. This should also >> improve performance due to memset() optimizations. >> >> diff --git a/exec-obsolete.h b/exec-obsolete.h >> index f8af27e..019c09a 100644 >> --- a/exec-obsolete.h >> +++ b/exec-obsolete.h >> @@ -76,6 +76,20 @@ static inline int >> cpu_physical_memory_set_dirty_flags(ram_addr_t addr, >> return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags; >> } >> >> +static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start, >> + int length, >> + int dirty_flags) >> +{ >> + int i, len; >> + uint8_t *p; >> + >> + len = length >> TARGET_PAGE_BITS; >> + p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS); >> + for (i = 0; i < len; i++) { >> + p[i] |= dirty_flags; >> + } >> +} >> + > > Breaks for start = 0xfff, length = 2.
Right. I copied this from cpu_physical_memory_mask_dirty_range() which suffers from the same problem.