MIPS: unaligned: Prevent EVA instructions on kernel unaligned accesses
authorMarkos Chandras <markos.chandras@imgtec.com>
Mon, 9 Mar 2015 14:54:50 +0000 (14:54 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 10 Apr 2015 13:41:44 +0000 (15:41 +0200)
commiteeb538950367e3966cbf0237ab1a1dc30e059818
treee5d34952dce301ed1095b54997958dede5cec80f
parent60cd7e08e453bc6828ac4b539f949e4acd80f143
MIPS: unaligned: Prevent EVA instructions on kernel unaligned accesses

Commit c1771216ab48 ("MIPS: kernel: unaligned: Handle unaligned
accesses for EVA") allowed unaligned accesses to be emulated for
EVA. However, when emulating regular load/store unaligned accesses,
we need to use the appropriate "address space" instructions for that.
Previously, an unaligned load/store instruction in kernel space would
have used the corresponding EVA instructions to emulate it which led to
segmentation faults because of the address translation that happens
with EVA instructions. This is now fixed by using the EVA instruction
only when emulating EVA unaligned accesses.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Fixes: c1771216ab48 ("MIPS: kernel: unaligned: Handle unaligned accesses for EVA")
Cc: <stable@vger.kernel.org> # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9501/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/unaligned.c