diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-18 02:35:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-10 12:49:36 -0400 |
commit | dff1316f4f15d9c3ff3ff9c11f2c92e0a2040a49 (patch) | |
tree | 4a51b60015d177e8acc24fc8300e801d9a442783 /arch | |
parent | b6f2faffa0a189c28a2f2242c0b23fb031ba3075 (diff) |
KVM: mips: use id_to_memslot correctly
commit 69a1220060c1523fd0515216eaa29e22f133b894 upstream.
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.
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-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 bb68e8d520e8..52f205ae1281 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) | |||
982 | 982 | ||
983 | /* If nothing is dirty, don't bother messing with page tables. */ | 983 | /* If nothing is dirty, don't bother messing with page tables. */ |
984 | if (is_dirty) { | 984 | if (is_dirty) { |
985 | memslot = &kvm->memslots->memslots[log->slot]; | 985 | memslot = id_to_memslot(kvm->memslots, log->slot); |
986 | 986 | ||
987 | ga = memslot->base_gfn << PAGE_SHIFT; | 987 | ga = memslot->base_gfn << PAGE_SHIFT; |
988 | ga_end = ga + (memslot->npages << PAGE_SHIFT); | 988 | ga_end = ga + (memslot->npages << PAGE_SHIFT); |