kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Matlack <dmatlack@google.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Ben Gardon <bgardon@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>, kvm <kvm@vger.kernel.org>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Yanan Wang <wangyanan55@huawei.com>
Subject: Re: [PATCH 3/3] KVM: selftests: Fix dirty bitmap offset calculation
Date: Thu, 16 Sep 2021 09:37:15 -0700	[thread overview]
Message-ID: <CALzav=cNk_bJDiBwjgQU+vJ8YGMM2ZSxuE0Hq0DnBi-n5aLD=Q@mail.gmail.com> (raw)
In-Reply-To: <20210916084922.x33twpy74auxojrk@gator.home>

On Thu, Sep 16, 2021 at 1:49 AM Andrew Jones <drjones@redhat.com> wrote:
>
> On Wed, Sep 15, 2021 at 02:55:03PM -0700, Ben Gardon wrote:
> > On Wed, Sep 15, 2021 at 2:30 PM David Matlack <dmatlack@google.com> wrote:
> > >
> > > The calculation to get the per-slot dirty bitmap was incorrect leading
> > > to a buffer overrun. Fix it by dividing the number of pages by
> > > BITS_PER_LONG, since each element of the bitmap is a long and there is
> > > one bit per page.
> > >
> > > Fixes: 609e6202ea5f ("KVM: selftests: Support multiple slots in dirty_log_perf_test")
> > > Signed-off-by: David Matlack <dmatlack@google.com>
> >
> > I was a little confused initially because we're allocating only one
> > dirty bitmap in userspace even when we have multiple slots, but that's
> > not a problem.
>
> It's also confusing to me. Wouldn't it be better to create a bitmap per
> slot? I think the new constraint that host mem must be a multiple of 64
> is unfortunate.

I don't think think the multiple-of-64 (256K) constraint will matter
much in practice. But it wouldn't be very complicated to switch to a
bitmap per slot, and would prevent further confusion.

I'll switch it over in v2.

>
> Thanks,
> drew
>

  reply	other threads:[~2021-09-16 18:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 21:30 [PATCH 0/3] KVM: selftests: Small fixes for dirty_log_perf_test David Matlack
2021-09-15 21:30 ` [PATCH 1/3] KVM: selftests: Change backing_src flag to -s in demand_paging_test David Matlack
2021-09-15 21:56   ` Ben Gardon
2021-09-16  8:34   ` Andrew Jones
2021-09-15 21:30 ` [PATCH 2/3] KVM: selftests: Refactor help message for -s backing_src David Matlack
2021-09-15 21:55   ` Ben Gardon
2021-09-16  8:41   ` Andrew Jones
2021-09-16 16:24     ` David Matlack
2021-09-15 21:30 ` [PATCH 3/3] KVM: selftests: Fix dirty bitmap offset calculation David Matlack
2021-09-15 21:55   ` Ben Gardon
2021-09-16  8:49     ` Andrew Jones
2021-09-16 16:37       ` David Matlack [this message]
2021-09-22 11:09       ` Paolo Bonzini
2021-09-22 11:19         ` Andrew Jones

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='CALzav=cNk_bJDiBwjgQU+vJ8YGMM2ZSxuE0Hq0DnBi-n5aLD=Q@mail.gmail.com' \
    --to=dmatlack@google.com \
    --cc=axelrasmussen@google.com \
    --cc=bgardon@google.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wangyanan55@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).