summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-05-18 08:35:43 +0200
committerSasha Levin <sasha.levin@oracle.com>2015-07-03 23:02:18 -0400
commit8f609d902228e0bb565e924636c168754e22fcdd (patch)
treeafc6f9d0c86c6c81fb069d69504e58e71b8d023b /arch
parentf731e5c7f3acae81a25f18ae01ae2641364f794c (diff)
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kvm/mips.c2
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);