All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch added to 3.12-stable] MIPS: KVM: Check for pfn noslot case
@ 2016-09-22  7:11 Jiri Slaby
  2016-09-22  7:11   ` Jiri Slaby
                   ` (40 more replies)
  0 siblings, 41 replies; 46+ messages in thread
From: Jiri Slaby @ 2016-09-22  7:11 UTC (permalink / raw)
  To: stable
  Cc: James Hogan, Paolo Bonzini, Radim Krčmář,
	Ralf Baechle, linux-mips, kvm, Jiri Slaby

From: James Hogan <james.hogan@imgtec.com>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

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 v3.16.y]
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 arch/mips/kvm/kvm_tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c
index 4bee4397dca8..8a47bd96cee3 100644
--- a/arch/mips/kvm/kvm_tlb.c
+++ b/arch/mips/kvm/kvm_tlb.c
@@ -182,7 +182,7 @@ static int kvm_mips_map_page(struct kvm *kvm, gfn_t gfn)
         srcu_idx = srcu_read_lock(&kvm->srcu);
 	pfn = kvm_mips_gfn_to_pfn(kvm, gfn);
 
-	if (kvm_mips_is_error_pfn(pfn)) {
+	if (is_error_noslot_pfn(pfn)) {
 		kvm_err("Couldn't get pfn for gfn %#" PRIx64 "!\n", gfn);
 		err = -EFAULT;
 		goto out;
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2016-09-23  8:23 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22  7:11 [patch added to 3.12-stable] MIPS: KVM: Check for pfn noslot case Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] x86/mm: Disable preemption during CR3 read+write Jiri Slaby
2016-09-22  7:11   ` Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] arm64: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO Jiri Slaby
2016-09-22  7:11   ` Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] parisc: Fix order of EREFUSED define in errno.h Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] PCI: Support PCIe devices with short cfg_size Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] PCI: Add Netronome vendor and device IDs Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] PCI: Limit config space size for Netronome NFP6000 family Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] PCI: Add Netronome NFP4000 PF device ID Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] PCI: Limit config space size for Netronome NFP4000 Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] usb: dwc3: gadget: increment request->actual once Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: validate wMaxPacketValue entries in endpoint descriptors Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] usb: xhci: Fix panic if disconnect Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: fix memleak in driver-registration error path Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: option: add D-Link DWM-156/A3 Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: option: add support for Telit LE920A4 Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: ftdi_sio: add device ID for WICED USB UART dev board Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: ftdi_sio: add PIDs for Ivium Technologies devices Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] xhci: Make sure xhci handles USB_SPEED_SUPER_PLUS devices Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] EDAC: Increment correct counter in edac_inc_ue_error() Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] s390/dasd: fix hanging device after clear subchannel Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] mac80211: fix purging multicast PS buffer queue Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] aacraid: Check size values after double-fetch from user Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] cdc-acm: fix wrong pipe type on rx interrupt xfers Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] megaraid_sas: Fix probing cards without io port Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] gpio: Fix OF build problem on UM Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] fs/seq_file: fix out-of-bounds read Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] Input: i8042 - break load dependency between atkbd/psmouse and i8042 Jiri Slaby
2016-09-22 16:37   ` Dmitry Torokhov
2016-09-23  8:23     ` Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] crypto: nx - off by one bug in nx_of_update_msc() Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: fix typo in wMaxPacketSize validation Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: mos7720: fix non-atomic allocation in write path Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] USB: serial: mos7840: " Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] staging: comedi: daqboard2000: bug fix board type matching code Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] ACPI / sysfs: fix error code in get_status() Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] Revert "can: fix handling of unmodifiable configuration options fix" Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] be2iscsi: Fix bogus WARN_ON length check Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] HID: hid-input: Add parentheses to quell gcc warning Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] ALSA: oxygen: Fix logical-not-parentheses warning Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] stb6100: fix buffer length check in stb6100_write_reg_range() Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] ext4: validate that metadata blocks do not overlap superblock Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] s390/sclp_ctl: fix potential information leak with /dev/sclp Jiri Slaby
2016-09-22  7:11 ` [patch added to 3.12-stable] fix d_walk()/non-delayed __d_free() race Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.