KVM: use kvm_memslots whenever possible
kvm_memslots provides lockdep checking. Use it consistently instead of
explicit dereferencing of kvm->memslots.
Reviewed-by: Radim Krcmar <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d42d8ac..8918e23 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7782,6 +7782,7 @@
const struct kvm_memory_slot *old,
enum kvm_mr_change change)
{
+ struct kvm_memslots *slots;
struct kvm_memory_slot *new;
int nr_mmu_pages = 0;
@@ -7803,7 +7804,8 @@
kvm_mmu_change_mmu_pages(kvm, nr_mmu_pages);
/* It's OK to get 'new' slot here as it has already been installed */
- new = id_to_memslot(kvm->memslots, mem->slot);
+ slots = kvm_memslots(kvm);
+ new = id_to_memslot(slots, mem->slot);
/*
* Dirty logging tracks sptes in 4k granularity, meaning that large