On Tue, 9 Mar 2021 at 16:20, Thomas Huth <th...@redhat.com> wrote: > The vga code basically does this: > > region_start = (s->start_addr * 4); > region_end = region_start + (ram_addr_t)s->line_offset * height; > region_end += width * depth / 8; /* scanline length */ > region_end -= s->line_offset; > ... > memory_region_snapshot_and_clear_dirty(... region_end - region_start...); > > Thus it uses a size that is nowhere guaranteed to be a multiple > of the page size.
The documentation comment for memory_region_snapshot_and_clear_dirty() says: * The dirty bitmap region which gets copyed into the snapshot (and * cleared afterwards) can be larger than requested. The boundaries * are rounded up/down That is, it is the job of memory_region_snapshot_and_clear_dirty() to round the boundaries up/down to whatever extent it requires internally. thanks -- PMM