linux/arch/mips
James Hogan a700434d80 MIPS: KVM: Reset CP0_PageMask during host TLB flush
KVM sometimes flushes host TLB entries, reading each one to check if it
corresponds to a guest KSeg0 address. In the absence of EntryHi.EHInv
bits to invalidate the whole entry, the entries will be set to unique
virtual addresses in KSeg0 (which is not TLB mapped), spaced 2*PAGE_SIZE
apart.

The TLB read however will clobber the CP0_PageMask register with
whatever page size that TLB entry had, and that same page size will be
written back into the TLB entry along with the unique address.

This would cause breakage when transparent huge pages are enabled on
64-bit host kernels, since huge page entries will overlap other nearby
entries when separated by only 2*PAGE_SIZE, causing a machine check
exception.

Fix this by restoring the old CP0_PageMask value (which should be set to
the normal page size) after reading the TLB entry if we're going to go
ahead and invalidate it.

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>
2016-08-01 18:42:27 +02:00
..
alchemy Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-19 10:02:26 -07:00
ar7 MIPS: ar7: use gpiochip data pointer 2016-02-19 09:51:43 +01:00
ath25 genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
ath79 TTY and Serial driver update for 4.7-rc1 2016-05-20 20:57:27 -07:00
bcm47xx MIPS: BCM47xx: Move SPROM driver to drivers/firmware/ 2016-05-13 14:01:43 +02:00
bcm63xx Merge branch 'ib-mfd-regulator-gpio-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into devel 2016-03-09 17:40:37 +07:00
bmips MIPS: BMIPS: Add support for BCM63268 2016-05-13 14:02:09 +02:00
boot MIPS: devicetree: fix cpu interrupt controller node-names 2016-05-28 12:35:12 +02:00
cavium-octeon MIPS: Add missing FROZEN hotplug notifier transitions 2016-05-28 12:35:12 +02:00
cobalt MIPS: Cobalt Don't use module_init in non-modular MTD registration. 2015-06-21 22:14:30 +02:00
configs arch/defconfig: remove CONFIG_RESOURCE_COUNTERS 2016-05-23 17:04:14 -07:00
dec MIPS: DEC: Export `ioasic_ssr_lock' to modules 2016-05-17 11:03:54 +02:00
emma
fw MIPS: Fix misspellings in comments. 2016-04-03 12:32:09 +02:00
include MIPS: Fix definition of KSEGX() for 64-bit 2016-08-01 18:42:20 +02:00
jazz MIPS: Jazz: Migrate to new 'set-state' interface 2015-09-03 12:07:50 +02:00
jz4740 MTD updates for v4.7: 2016-05-24 11:00:20 -07:00
kernel MIPS: inst.h: Rename cbcond{0,1}_op to pop{1,3}0_op 2016-07-05 16:09:07 +02:00
kvm MIPS: KVM: Reset CP0_PageMask during host TLB flush 2016-08-01 18:42:27 +02:00
lantiq MIPS: Change my email address 2016-05-13 14:02:18 +02:00
lasat MIPS: Lasat: A couple off by one bugs in picvue_proc.c 2016-05-28 12:35:06 +02:00
lib MIPS: lib: Mark intrinsics notrace 2016-05-28 12:35:11 +02:00
loongson32 MIPS: Loongson1B: Some updates/fixes for LS1B 2016-05-13 14:02:05 +02:00
loongson64 MIPS: Loongson64: Fix typo 2016-05-28 12:35:07 +02:00
math-emu MIPS: inst.h: Rename cbcond{0,1}_op to pop{1,3}0_op 2016-07-05 16:09:07 +02:00
mm MIPS: uasm: Add r6 MUL encoding 2016-07-05 16:08:40 +02:00
mti-malta MIPS: malta-time: Take seconds into account 2016-05-13 15:30:25 +02:00
mti-sead3 MIPS: Introduce plat_get_fdt a platform API to retrieve the FDT 2016-05-13 14:02:03 +02:00
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-06 00:43:52 -05:00
netlogic MIPS: Define & use CP0_EBase bit definitions 2016-05-13 15:30:25 +02:00
oprofile MIPS: oprofile: Fix typo 2016-05-28 12:35:09 +02:00
paravirt MIPS: SMP: Don't increment irq_count multiple times for call function IPIs 2015-08-03 09:25:12 +02:00
pci MIPS: IP27: Fix typo 2016-05-28 12:35:07 +02:00
pic32 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-19 10:02:26 -07:00
pistachio MIPS: Pistachio: Enable KASLR 2016-05-28 12:35:11 +02:00
pmcs-msp71xx MIPS: MSP71xx: Use __flush_cache_all instead of flush_cache_all. 2016-05-13 14:01:38 +02:00
pnx833x MIPS: make PCI_DMA_BUS_IS_PHYS=1 constant 2016-05-13 14:02:17 +02:00
power MIPS: Hibernate: flush TLB entries earlier 2015-04-10 15:41:52 +02:00
ralink MIPS: ralink: add MT7628 EPHY LEDs pinmux support 2016-05-28 12:35:05 +02:00
rb532 MIPS: rb532: use gpiochip data pointer 2016-02-19 09:51:44 +01:00
sgi-ip22
sgi-ip27 MIPS: Spelling fix lets -> let's 2016-05-28 12:35:09 +02:00
sgi-ip32 MIPS: IP32: Fix build errors in reset code in DS1685 platform hook. 2015-05-13 00:01:41 +02:00
sibyte MIPS: Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER 2016-05-09 12:00:03 +02:00
sni MIPS: Spelling fix lets -> let's 2016-05-28 12:35:09 +02:00
txx9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
vdso MIPS: Build microMIPS VDSO for microMIPS kernels 2016-05-28 12:35:12 +02:00
vr41xx MIPS: VR41xx: Fix typo 2016-05-28 12:35:09 +02:00
xilfpga Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
Kbuild MIPS: Initial implementation of a VDSO 2015-11-11 08:36:36 +01:00
Kbuild.platforms MIPS: Add support for PIC32MZDA platform 2016-01-24 02:53:28 +01:00
Kconfig Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-28 16:41:39 -07:00
Kconfig.debug MIPS: CPS: Early debug using an ns16550-compatible UART 2015-11-11 08:34:25 +01:00
Makefile MIPS: Fix VZ probe gas errors with binutils <2.24 2016-05-17 11:06:04 +02:00