Commit 7e988b10 authored by Christian Borntraeger's avatar Christian Borntraeger

KVM: use correct accessor function for __kvm_memslots

kvm memslots are protected by srcu and not by rcu. We must use
srcu_dereference_check instead of rcu_dereference_check.
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent a80cf7b5
...@@ -568,9 +568,8 @@ void kvm_put_kvm(struct kvm *kvm); ...@@ -568,9 +568,8 @@ void kvm_put_kvm(struct kvm *kvm);
static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id) static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id)
{ {
return rcu_dereference_check(kvm->memslots[as_id], return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu,
srcu_read_lock_held(&kvm->srcu) lockdep_is_held(&kvm->slots_lock));
|| lockdep_is_held(&kvm->slots_lock));
} }
static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment