All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Thomas Huth <thuth@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>,
	Kunkun Jiang <jiangkunkun@huawei.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Peter Xu <peterx@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>, Gerd Hoffmann <kraxel@redhat.com>,
	wanghaibin.wang@huawei.com, Zenghui Yu <yuzenghui@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Keqian Zhu <zhukeqian1@huawei.com>
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	[thread overview]
Message-ID: <CAFEAcA-jnVADA85uTxPUUHfPLacN5+-d=D8MjKzfr3bT2hL7gw@mail.gmail.com> (raw)
In-Reply-To: <48fd9bee-4542-533a-b893-7acf3744fe36@redhat.com>

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	other threads:[~2021-03-09 18:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  1:49 [PATCH v2 0/2] accel: kvm: Some bugfixes for kvm dirty log Keqian Zhu
2020-12-17  1:49 ` [PATCH v2 1/2] accel: kvm: Fix memory waste under mismatch page size Keqian Zhu
2020-12-17  1:49 ` [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot Keqian Zhu
2020-12-17 12:18   ` Andrew Jones
2020-12-17 14:36   ` Peter Xu
2021-02-01 15:14   ` Philippe Mathieu-Daudé
2021-02-02  1:17     ` Keqian Zhu
2021-03-09 13:48   ` Thomas Huth
2021-03-09 14:05     ` Keqian Zhu
2021-03-09 14:45       ` Thomas Huth
2021-03-09 14:57         ` Dr. David Alan Gilbert
2021-03-09 16:08           ` Peter Xu
2021-03-10  1:57             ` Keqian Zhu
2021-03-09 16:20           ` Thomas Huth
2021-03-09 16:26             ` Peter Maydell [this message]
2021-03-09 19:03               ` Paolo Bonzini
2021-03-09 15:11         ` zhukeqian
2021-01-06  7:07 ` [PATCH v2 0/2] accel: kvm: Some bugfixes for kvm dirty log Keqian Zhu
2021-01-25  7:51 ` Keqian Zhu
2021-02-01 13:07   ` Keqian Zhu
2021-03-02 11:43 ` [PING] " Keqian Zhu
2021-03-02 13:14   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA-jnVADA85uTxPUUHfPLacN5+-d=D8MjKzfr3bT2hL7gw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=jiangkunkun@huawei.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wanghaibin.wang@huawei.com \
    --cc=yuzenghui@huawei.com \
    --cc=zhukeqian1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.