]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
MIPS: KVM: Check for pfn noslot case
authorJames Hogan <james.hogan@imgtec.com>
Fri, 19 Aug 2016 13:30:29 +0000 (14:30 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:04:43 +0000 (08:04 -0500)
commitb127da297aede46f22af4d5fe8e739f104c1fe8a
tree6beb330a5c3d8a515ec347b7afcd54ba8fa26c87
parent18834c3f4d41b00f11c9ca9a5b29a2c5904fb397
MIPS: KVM: Check for pfn noslot case

BugLink: http://bugs.launchpad.net/bugs/1627730
commit ba913e4f72fc9cfd03dad968dfb110eb49211d80 upstream.

When mapping a page into the guest we error check using is_error_pfn(),
however this doesn't detect a value of KVM_PFN_NOSLOT, indicating an
error HVA for the page. This can only happen on MIPS right now due to
unusual memslot management (e.g. being moved / removed / resized), or
with an Enhanced Virtual Memory (EVA) configuration where the default
KVM_HVA_ERR_* and kvm_is_error_hva() definitions are unsuitable (fixed
in a later patch). This case will be treated as a pfn of zero, mapping
the first page of physical memory into the guest.

It would appear the MIPS KVM port wasn't updated prior to being merged
(in v3.10) to take commit 81c52c56e2b4 ("KVM: do not treat noslot pfn as
a error pfn") into account (merged v3.8), which converted a bunch of
is_error_pfn() calls to is_error_noslot_pfn(). Switch to using
is_error_noslot_pfn() instead to catch this case properly.

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čmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[james.hogan@imgtec.com: Backport to v4.7.y]
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/mips/kvm/tlb.c