On Thu, Sep 16, 2021 at 1:49 AM Andrew Jones <drjones@xxxxxxxxxx> 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@xxxxxxxxxx> 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@xxxxxxxxxx> > > > > 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 >