* [PATCH] KVM: mips: use id_to_memslot correctly
@ 2015-05-18 8:14 Paolo Bonzini
2015-05-18 10:15 ` James Hogan
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2015-05-18 8:14 UTC (permalink / raw)
To: linux-kernel, kvm; +Cc: stable, James Hogan
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
Cc: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
arch/mips/kvm/mips.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
/* 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);
--
2.4.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: mips: use id_to_memslot correctly
2015-05-18 8:14 [PATCH] KVM: mips: use id_to_memslot correctly Paolo Bonzini
@ 2015-05-18 10:15 ` James Hogan
0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2015-05-18 10:15 UTC (permalink / raw)
To: Paolo Bonzini, linux-kernel, kvm; +Cc: stable
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
Hi Paolo,
On 18/05/15 09:14, Paolo Bonzini wrote:
> 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
> Cc: James Hogan <james.hogan@imgtec.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
(I have the same patch in my pile).
Thanks
James
> ---
> arch/mips/kvm/mips.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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)
>
> /* 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);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-18 10:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 8:14 [PATCH] KVM: mips: use id_to_memslot correctly Paolo Bonzini
2015-05-18 10:15 ` James Hogan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).