diff options
author | Peter Xu <peterx@redhat.com> | 2021-05-06 12:05:44 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-05-26 14:49:45 +0200 |
commit | 2c20b27eed517f9624b008222bb486f1df0ae079 (patch) | |
tree | 39f7feb332201f9642c1c7739958bb2075bb437f /include/sysemu/kvm_int.h | |
parent | e65e5f50db0a54a69cc62c2118d010244bf133ac (diff) | |
download | qemu-2c20b27eed517f9624b008222bb486f1df0ae079.zip qemu-2c20b27eed517f9624b008222bb486f1df0ae079.tar.gz qemu-2c20b27eed517f9624b008222bb486f1df0ae079.tar.bz2 |
KVM: Provide helper to sync dirty bitmap from slot to ramblock
kvm_physical_sync_dirty_bitmap() calculates the ramblock offset in an
awkward way from the MemoryRegionSection that passed in from the
caller. The truth is for each KVMSlot the ramblock offset never
change for the lifecycle. Cache the ramblock offset for each KVMSlot
into the structure when the KVMSlot is created.
With that, we can further simplify kvm_physical_sync_dirty_bitmap()
with a helper to sync KVMSlot dirty bitmap to the ramblock dirty
bitmap of a specific KVMSlot.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210506160549.130416-6-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/sysemu/kvm_int.h')
-rw-r--r-- | include/sysemu/kvm_int.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index e13075f..ab09a15 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -25,6 +25,8 @@ typedef struct KVMSlot unsigned long *dirty_bmap; /* Cache of the address space ID */ int as_id; + /* Cache of the offset in ram address space */ + ram_addr_t ram_start_offset; } KVMSlot; typedef struct KVMMemoryListener { |