linux-stable/arch/mips
Paul Burton fa8ff601d7 MIPS: Fix MSA ld unaligned failure cases
Copying the content of an MSA vector from user memory may involve TLB
faults & mapping in pages. This will fail when preemption is disabled
due to an inability to acquire mmap_sem from do_page_fault, which meant
such vector loads to unmapped pages would always fail to be emulated.
Fix this by disabling preemption later only around the updating of
vector register state.

This change does however introduce a race between performing the load
into thread context & the thread being preempted, saving its current
live context & clobbering the loaded value. This should be a rare
occureence, so optimise for the fast path by simply repeating the load if
we are preempted.

Additionally if the copy failed then the failure path was taken with
preemption left disabled, leading to the kernel typically encountering
further issues around sleeping whilst atomic. The change to where
preemption is disabled avoids this issue.

Fixes: e4aa1f153a "MIPS: MSA unaligned memory access support"
Reported-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: James Cowgill <James.Cowgill@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: stable <stable@vger.kernel.org> # v4.3
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12345/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-03-29 14:18:18 +02:00
..
alchemy MIPS: alchemy: switch to gpiochip_add_data() 2016-02-19 09:51:43 +01: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 irqchip/ath79-cpu: Move the CPU IRQ driver from arch/mips/ath79/ 2016-02-17 13:47:19 +00:00
bcm47xx Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-01-24 12:50:56 -08: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 irqchips/bmips: Add bcm6345-l1 interrupt controller 2016-02-08 15:03:42 +01:00
boot regmap: Updates for v4.6 2016-03-15 21:22:26 -07:00
cavium-octeon Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
cobalt MIPS: Cobalt Don't use module_init in non-modular MTD registration. 2015-06-21 22:14:30 +02:00
configs KEYS: CONFIG_KEYS_DEBUG_PROC_KEYS is no longer an option 2016-02-10 10:13:27 +00:00
dec
emma
fw
include MTD updates for v4.6 2016-03-24 19:57:15 -07:00
jazz MIPS: Jazz: Migrate to new 'set-state' interface 2015-09-03 12:07:50 +02:00
jz4740 MIPS: jz4740: Fix surviving instance of irq_to_gpio() 2016-02-29 11:23:49 +01:00
kernel MIPS: Fix MSA ld unaligned failure cases 2016-03-29 14:18:18 +02:00
kvm Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-14 19:14:06 -07:00
lantiq MIPS: Make MIPS_CMDLINE_DTB default 2015-11-11 08:38:37 +01:00
lasat [mips] switch pvc_proc_cleanup() to remove_proc_subtree() 2015-12-23 10:41:38 -05:00
lib MIPS: Cleanup the unused __arch_local_irq_restore() function 2016-01-22 01:58:49 +01:00
loongson32 MIPS: loongsoon32: Migrate to new 'set-state' interface 2015-09-03 12:07:53 +02:00
loongson64 MIPS: hpet: Choose a safe value for the ETIME check 2016-01-22 02:00:49 +01:00
math-emu MIPS: math-emu: dsemul: Reduce `get_isa16_mode' clutter 2016-01-24 01:37:09 +01:00
mm Merge branch 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-20 19:08:56 -07:00
mti-malta MIPS: Fix early CM probing 2016-02-09 17:18:31 +01:00
mti-sead3 LED/MIPS: Move SEAD3 LED driver to where it belongs. 2015-11-03 08:59:20 +01:00
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-06 00:43:52 -05:00
netlogic MIPS: Make MIPS_CMDLINE_DTB default 2015-11-11 08:38:37 +01:00
oprofile MIPS: Add cases for CPU_I6400 2015-08-26 15:23:03 +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 PCI changes for the v4.6 merge window: 2016-03-16 14:45:55 -07:00
pic32 clk: Get rid of HAVE_MACH_CLKDEV 2016-02-25 14:41:20 -08:00
pistachio Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-11-15 09:10:53 -08:00
pmcs-msp71xx serial: Fix ASYNC_* => UPF_* flags misuse 2016-01-28 14:17:42 -08:00
pnx833x mips: nand: make use of mtd_to_nand() where appropriate 2015-12-08 13:03:07 -08:00
power MIPS: Hibernate: flush TLB entries earlier 2015-04-10 15:41:52 +02:00
ralink MIPS: pci: Add MT7620a PCIE driver 2016-01-20 00:39:20 +01:00
rb532 MIPS: rb532: use gpiochip data pointer 2016-02-19 09:51:44 +01:00
sgi-ip22
sgi-ip27 MIPS: IP27: Migrate to new 'set-state' interface 2015-09-03 12:07:54 +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: Move bus watcher from deprecated __initcall to device_initcall 2015-09-03 12:07:49 +02:00
sni MIPS: Fix build error due to unused variables. 2015-12-22 15:21:18 +01:00
txx9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-03-19 10:05:34 -07:00
vdso Fix ld-version.sh to handle large 3rd version part 2016-01-04 10:22:52 +01:00
vr41xx MIPS/IRQCHIP: Move irq_chip from arch/mips to drivers/irqchip. 2015-06-21 21:52:50 +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 The clk changes for this release cycle are mostly dominated by 2016-03-23 06:06:45 -07:00
Kconfig.debug MIPS: CPS: Early debug using an ns16550-compatible UART 2015-11-11 08:34:25 +01:00
Makefile MIPS: Loongson-3: Improve -march option and move it to Platform 2016-01-22 01:59:18 +01:00