aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2012-12-21 08:20:16 -0700
committerGleb Natapov <gleb@redhat.com>2012-12-23 10:17:38 +0200
commit116c14c0191f3378e6567af296529ac287e85aa2 (patch)
tree98b6f582d2d2f83da21918a95bfea48f1d37d84e /include/linux/kvm_host.h
parentKVM: remove a wrong hack of delivery PIT intr to vcpu0 (diff)
downloadlinux-dev-116c14c0191f3378e6567af296529ac287e85aa2.tar.xz
linux-dev-116c14c0191f3378e6567af296529ac287e85aa2.zip
kvm: Fix memory slot generation updates
Previous patch "kvm: Minor memory slot optimization" (b7f69c555ca43) overlooked the generation field of the memory slots. Re-using the original memory slots left us with with two slightly different memory slots with the same generation. To fix this, make update_memslots() take a new parameter to specify the last generation. This also makes generation management more explicit to avoid such problems in the future. Reported-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 32fdc45ca35e..cbe0d683e2e5 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -428,7 +428,8 @@ void kvm_exit(void);
void kvm_get_kvm(struct kvm *kvm);
void kvm_put_kvm(struct kvm *kvm);
-void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new);
+void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new,
+ u64 last_generation);
static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
{