]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: mips: use id_to_memslot correctly
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 18 May 2015 06:35:43 +0000 (08:35 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 May 2015 18:52:44 +0000 (20:52 +0200)
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>
arch/mips/kvm/mips.c

index 71f345b499c8d0df42efb165bb8f171e4af56832..a8e660a444743ef67b58b00bf085ff57edc8c445 100644 (file)
@@ -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);