1
0
Fork 0
alistair23-linux/arch/mips/kvm
James Hogan c604cffa93 MIPS: KVM: Fix mapped fault broken commpage handling
kvm_mips_handle_mapped_seg_tlb_fault() appears to map the guest page at
virtual address 0 to PFN 0 if the guest has created its own mapping
there. The intention is unclear, but it may have been an attempt to
protect the zero page from being mapped to anything but the comm page in
code paths you wouldn't expect from genuine commpage accesses (guest
kernel mode cache instructions on that address, hitting trapping
instructions when executing from that address with a coincidental TLB
eviction during the KVM handling, and guest user mode accesses to that
address).

Fix this to check for mappings exactly at KVM_GUEST_COMMPAGE_ADDR (it
may not be at address 0 since commit 42aa12e74e ("MIPS: KVM: Move
commpage so 0x0 is unmapped")), and set the corresponding EntryLo to be
interpreted as 0 (invalid).

Fixes: 858dd5d457 ("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
Cc: <stable@vger.kernel.org> # 3.10.x-
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
2016-08-12 12:01:28 +02:00
..
00README.txt KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
Kconfig MIPS; KVM: Convert exception entry to uasm 2016-07-05 16:08:46 +02:00
Makefile MIPS; KVM: Convert exception entry to uasm 2016-07-05 16:08:46 +02:00
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
commpage.c MIPS: KVM: Move commpage so 0x0 is unmapped 2016-06-15 23:58:36 +02:00
commpage.h MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" 2014-06-30 16:52:03 +02:00
dyntrans.c MIPS: KVM: Fix ptr->int cast via KVM_GUEST_KSEGX() 2016-08-01 18:42:26 +02:00
emulate.c MIPS: KVM: Sign extend MFC0/RDHWR results 2016-08-01 18:42:25 +02:00
entry.c MIPS: KVM: Use 64-bit CP0_EBase when appropriate 2016-08-01 18:42:24 +02:00
fpu.S MIPS: KVM: Fix fpu.S misassembly with r6 2016-07-05 16:09:11 +02:00
interrupt.c MIPS: KVM: Convert code to kernel sized types 2016-06-14 11:02:41 +02:00
interrupt.h MIPS; KVM: Convert exception entry to uasm 2016-07-05 16:08:46 +02:00
mips.c MIPS: KVM: Fail if ebase doesn't fit in CP0_EBase 2016-08-01 18:42:24 +02:00
mmu.c MIPS: KVM: Fix mapped fault broken commpage handling 2016-08-12 12:01:28 +02:00
msa.S MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
stats.c MIPS: KVM: Clean up kvm_exit trace event 2016-06-14 11:16:23 +02:00
tlb.c MIPS: KVM: Reset CP0_PageMask during host TLB flush 2016-08-01 18:42:27 +02:00
trace.h MIPS: KVM: Combine entry trace events into class 2016-06-23 19:17:30 +02:00
trap_emul.c MIPS: KVM: Emulate generic QEMU machine on r6 T&E 2016-07-05 16:09:20 +02:00