KVM: Add memory slot versioning and use it to provide fast guest write interface
Keep track of memslots changes by keeping generation number in memslots structure. Provide kvm_write_guest_cached() function that skips gfn_to_hva() translation if memslots was not changed since previous invocation. Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
@ -3190,6 +3190,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
|
||||
}
|
||||
memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots));
|
||||
slots->memslots[log->slot].dirty_bitmap = dirty_bitmap;
|
||||
slots->generation++;
|
||||
|
||||
old_slots = kvm->memslots;
|
||||
rcu_assign_pointer(kvm->memslots, slots);
|
||||
|
Reference in New Issue
Block a user