Gavin Shan <gs...@redhat.com> wrote: > When dirty ring is enabled on ARM64, the backup bitmap may be used > to track the dirty pages in no-running-vcpu situations. The original > bitmap is the primary one, used for the dirty ring buffer. We need > the secondary bitmap to collect the backup bitmap for ARM64. > > No functional change intended. > > Signed-off-by: Gavin Shan <gs...@redhat.com> > --- > accel/kvm/kvm-all.c | 50 ++++++++++++++++++++++++++++++---------- > include/sysemu/kvm_int.h | 1 + > 2 files changed, 39 insertions(+), 12 deletions(-) > > diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c > index 01a6a026af..1a93985574 100644 > --- a/accel/kvm/kvm-all.c > +++ b/accel/kvm/kvm-all.c > @@ -553,13 +553,29 @@ static void kvm_log_stop(MemoryListener *listener, > } > } > > +static unsigned long *kvm_slot_dirty_bitmap(KVMSlot *slot, bool primary) > +{ > + if (primary) { > + return slot->dirty_bmap; > + } > + > + return slot->dirty_bmap + > + slot->dirty_bmap_size / sizeof(slot->dirty_bmap[0]); > +}
Why? Just use two bitmaps and call it a day. Later, Juan.