]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: tlbex: Fix potential HTW race on TLBL/M/S handlers
authorLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Thu, 27 Nov 2014 11:13:08 +0000 (11:13 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 27 Nov 2014 16:21:56 +0000 (17:21 +0100)
commit1acaed0bc3a7201d5dcca2adf4fd8f58bc622853
treea873e8a0d4424ab18274d7b6ecc32537f5f8cccc
parent5130cd0185f987a394ac3f6362fa3ea5d9fbca3b
MIPS: tlbex: Fix potential HTW race on TLBL/M/S handlers

There is a potential race when probing the TLB in TLBL/M/S exception
handlers for a matching entry. Between the time we hit a TLBL/S/M
exception and the time we get to execute the TLBP instruction, the
HTW may have replaced the TLB entry we are interested in hence the TLB
probe may fail. However, in the existing handlers, we never checked the
status of the TLBP (ie check the result in the C0/Index register). We
fix this by adding such a check when the core implements the HTW. If
we couldn't find a matching entry, we return back and try again.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Cc: <stable@vger.kernel.org> # v3.17+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8599/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/tlbex.c