qemu-patch-raspberry4/accel/kvm
Peter Xu ea776d15ad KVM: Create the KVMSlot dirty bitmap on flag changes
Previously we have two places that will create the per KVMSlot dirty
bitmap:

  1. When a newly created KVMSlot has dirty logging enabled,
  2. When the first log_sync() happens for a memory slot.

The 2nd case is lazy-init, while the 1st case is not (which is a fix
of what the 2nd case missed).

To do explicit initialization of dirty bitmaps, what we're missing is
to create the dirty bitmap when the slot changed from not-dirty-track
to dirty-track.  Do that in kvm_slot_update_flags().

With that, we can safely remove the 2nd lazy-init.

This change will be needed for kvm dirty ring because kvm dirty ring
does not use the log_sync() interface at all.

Also move all the pre-checks into kvm_slot_init_dirty_bitmap().

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210506160549.130416-4-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-26 14:49:45 +02:00
..
kvm-accel-ops.c accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
kvm-all.c KVM: Create the KVMSlot dirty bitmap on flag changes 2021-05-26 14:49:45 +02:00
kvm-cpus.h accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
meson.build accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
sev-stub.c confidential guest support: Move SEV initialization into arch specific code 2021-02-08 16:57:38 +11:00
trace-events kvm: kvm_init_vcpu take Error pointer 2020-10-05 16:41:22 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00