qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one


From: Peter Maydell
Subject: Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot
Date: Tue, 9 Mar 2021 16:26:39 +0000

On Tue, 9 Mar 2021 at 16:20, Thomas Huth <thuth@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]