aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-10-18 09:22:23 -0400
committerAvi Kivity <avi@redhat.com>2011-01-12 04:23:08 -0500
commit49c7754ce57063b819b01eb8a4290841ad0886c4 (patch)
tree67561bbc829d93efa5316c246ec84fe2f2493236 /arch/x86/kvm/x86.c
parent56028d0861e48f7cc9c573d79f2d8a0a933a2bba (diff)
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>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 71beb27597fd..bd254779d1cc 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3190,6 +3190,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
3190 } 3190 }
3191 memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots)); 3191 memcpy(slots, kvm->memslots, sizeof(struct kvm_memslots));
3192 slots->memslots[log->slot].dirty_bitmap = dirty_bitmap; 3192 slots->memslots[log->slot].dirty_bitmap = dirty_bitmap;
3193 slots->generation++;
3193 3194
3194 old_slots = kvm->memslots; 3195 old_slots = kvm->memslots;
3195 rcu_assign_pointer(kvm->memslots, slots); 3196 rcu_assign_pointer(kvm->memslots, slots);