diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-18 08:35:43 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-07-03 23:02:18 -0400 |
commit | 8f609d902228e0bb565e924636c168754e22fcdd (patch) | |
tree | afc6f9d0c86c6c81fb069d69504e58e71b8d023b | |
parent | f731e5c7f3acae81a25f18ae01ae2641364f794c (diff) | |
download | lwn-8f609d902228e0bb565e924636c168754e22fcdd.tar.gz lwn-8f609d902228e0bb565e924636c168754e22fcdd.zip |
KVM: mips: use id_to_memslot correctly
[ Upstream commit 69a1220060c1523fd0515216eaa29e22f133b894 ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.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 39074fb83bad..a53eaf50c224 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c @@ -784,7 +784,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); |