linux/arch/mips
James Hogan 7ad26023ff MIPS: KVM: Fix modular KVM under QEMU
commit 797179bc4f upstream.

Copy __kvm_mips_vcpu_run() into unmapped memory, so that we can never
get a TLB refill exception in it when KVM is built as a module.

This was observed to happen with the host MIPS kernel running under
QEMU, due to a not entirely transparent optimisation in the QEMU TLB
handling where TLB entries replaced with TLBWR are copied to a separate
part of the TLB array. Code in those pages continue to be executable,
but those mappings persist only until the next ASID switch, even if they
are marked global.

An ASID switch happens in __kvm_mips_vcpu_run() at exception level after
switching to the guest exception base. Subsequent TLB mapped kernel
instructions just prior to switching to the guest trigger a TLB refill
exception, which enters the guest exception handlers without updating
EPC. This appears as a guest triggered TLB refill on a host kernel
mapped (host KSeg2) address, which is not handled correctly as user
(guest) mode accesses to kernel (host) segments always generate address
error exceptions.

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: kvm@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-07-27 09:47:30 -07:00
..
alchemy pcmcia: db1xxx_ss: fix last irq_to_gpio user 2016-04-20 15:42:09 +09:00
ar7
ath25
ath79 MIPS: ath79: make bootconsole wait for both THRE and TEMT 2016-06-07 18:14:31 -07:00
bcm47xx
bcm63xx
bmips
boot MIPS: ath79: Fix the size of the MISC INTC registers in ar9132.dtsi 2015-11-20 12:14:27 +01:00
cavium-octeon
cobalt
configs
dec
emma
fw
include MIPS: KVM: Fix modular KVM under QEMU 2016-07-27 09:47:30 -07:00
jazz
jz4740
kernel MIPS: Fix sigreturn via VDSO on microMIPS kernel 2016-06-07 18:14:31 -07:00
kvm MIPS: KVM: Fix modular KVM under QEMU 2016-07-27 09:47:30 -07:00
lantiq
lasat
lib MIPS: lib: Mark intrinsics notrace 2016-06-07 18:14:32 -07:00
loongson32
loongson64 MIPS: Loongson-3: Reserve 32MB for RS780E integrated GPU 2016-06-07 18:14:31 -07:00
math-emu MIPS: math-emu: Fix jalr emulation when rd == $0 2016-06-07 18:14:30 -07:00
mm MIPS: Sync icache & dcache in set_pte_at 2016-06-07 18:14:31 -07:00
mti-malta
mti-sead3
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-06 00:43:52 -05:00
netlogic
oprofile
paravirt
pci MIPS: Fix build error due to unused variables. 2015-12-22 15:21:18 +01:00
pistachio
pmcs-msp71xx MIPS: Fix build error due to unused variables. 2015-12-22 15:21:18 +01:00
pnx833x
power
ralink
rb532
sgi-ip22
sgi-ip27
sgi-ip32
sibyte
sni MIPS: Fix build error due to unused variables. 2015-12-22 15:21:18 +01:00
txx9
vdso MIPS: VDSO: Build with `-fno-strict-aliasing' 2016-06-07 18:14:32 -07:00
vr41xx
xilfpga
Kbuild
Kbuild.platforms
Kconfig MIPS: Fix build error when SMP is used without GIC 2016-03-16 08:43:01 -07:00
Kconfig.debug
Makefile