MIPS: KVM: Fix gfn range check in kseg0 tlb faults
authorJames Hogan <james.hogan@imgtec.com>
Thu, 18 Aug 2016 09:22:54 +0000 (10:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Aug 2016 21:22:39 +0000 (23:22 +0200)
commit8cee00e93cb1b7bedd6e4bf56e964ac315437013
tree80d6af173a43072ec33836c927c9edbc5ab1b8ae
parent2336de8d713a4b5986b809906e172f35e466d048
MIPS: KVM: Fix gfn range check in kseg0 tlb faults

commit 0741f52d1b980dbeb290afe67d88fc2928edd8ab upstream.

Two consecutive gfns are loaded into host TLB, so ensure the range check
isn't off by one if guest_pmap_npages is odd.

Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim KrÄ\8dmáÅ\99" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Radim KrÄ\8dmáÅ\99 <rkrcmar@redhat.com>
[james.hogan@imgtec.com: Backport to v3.10.y - v3.15.y]
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/mips/kvm/kvm_tlb.c