]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: asm: uaccess: Add v1 register to clobber list on EVA
authorMarkos Chandras <markos.chandras@imgtec.com>
Mon, 17 Nov 2014 09:30:23 +0000 (09:30 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 19 Nov 2014 17:22:08 +0000 (18:22 +0100)
commitb0da72dfa38013faaa8c876c0e24e4355c4b5e3e
tree3c0becc2bde0f5b98b7bbbe482d615247dfafa8b
parent696e5132e2e7082561d3b3b29c85d90015c58057
MIPS: asm: uaccess: Add v1 register to clobber list on EVA

When EVA is turned on and prefetching is being used in memcpy.S,
the v1 register is being used as a helper register to the PREFE
instruction. However, v1 ($3) was not in the clobber list, which
means that the compiler did not preserve it across function calls,
and that could corrupt the value of the register leading to all
sorts of userland crashes. We fix this problem by using the
DADDI_SCRATCH macro to define the clobbered register when
CONFIG_EVA && CONFIG_CPU_HAS_PREFETCH are enabled.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: <stable@vger.kernel.org> # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8510/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/uaccess.h