diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-18 08:35:43 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-19 20:52:44 +0200 |
commit | 69a1220060c1523fd0515216eaa29e22f133b894 (patch) | |
tree | 5cbe5e132d31ffeeecfcc91337a24489bbdb7dfc | |
parent | d81135a57aa66e5bec55cdfe4dda79633f9082dd (diff) |
KVM: mips: use id_to_memslot correctly
The argument to KVM_GET_DIRTY_LOG is a memslot id; it may not match the
position in the memslots array, which is sorted by gfn.
Cc: stable@vger.kernel.org
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/mips/kvm/mips.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c index 71f345b499c8..a8e660a44474 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c @@ -982,7 +982,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log) /* If nothing is dirty, don't bother messing with page tables. */ if (is_dirty) { - memslot = &kvm->memslots->memslots[log->slot]; + memslot = id_to_memslot(kvm->memslots, log->slot); ga = memslot->base_gfn << PAGE_SHIFT; ga_end = ga + (memslot->npages << PAGE_SHIFT); |