android_kernel_oneplus_msm8998/arch
Paul Burton af22bb95d9 MIPS: Fix MSA ld unaligned failure cases
commit fa8ff601d72bad3078ddf5ef17a5547700d06908 upstream.

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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-20 15:42:08 +09:00
..
alpha
arc ARC: bitops: Remove non relevant comments 2016-04-12 09:08:56 -07:00
arm ARM: dts: at91: sama5d4 Xplained: don't disable hsmci regulator 2016-04-12 09:09:03 -07:00
arm64 arm64: opcodes.h: Add arm big-endian config options before including arm header 2016-04-20 15:41:55 +09:00
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64 ia64: define ioremap_uc() 2016-04-12 09:08:54 -07:00
m32r m32r: fix m32104ut_defconfig build fail 2016-02-25 12:01:22 -08:00
m68k
metag
microblaze
mips MIPS: Fix MSA ld unaligned failure cases 2016-04-20 15:42:08 +09:00
mn10300
nios2
openrisc
parisc parisc: Unbreak handling exceptions from kernel modules 2016-04-20 15:41:52 +09:00
powerpc powerpc/mm: Fixup preempt underflow with huge pages 2016-04-20 15:41:53 +09:00
s390 s390/pci: enforce fmb page boundary rule 2016-04-12 09:08:37 -07:00
score
sh sched/preempt, sh: kmap_coherent relies on disabled preemption 2016-04-12 09:08:36 -07:00
sparc sparc64: fix incorrect sign extension in sys_sparc64_personality 2016-03-03 15:07:17 -08:00
tile tile: provide CONFIG_PAGE_SIZE_64KB etc for tilepro 2016-01-05 08:16:09 -05:00
um fs/coredump: prevent fsuid=0 dumps into user-controlled directories 2016-04-12 09:08:58 -07:00
unicore32
x86 KVM: x86: reduce default value of halt_poll_ns parameter 2016-04-20 15:42:07 +09:00
xtensa xtensa: clear all DBREAKC registers on start 2016-04-12 09:08:55 -07:00
.gitignore
Kconfig