]> git.hungrycats.org Git - linux/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2014 23:57:14 +0000 (15:57 -0800)
commitbad492272fb69acc24890a3e1dc5557c0802e668
treef9c1678af30246b4686aa8d23219b3509304de17
parentb7fbbff75e5c175ad198d5648b30b085d49c89bd
MIPS: tlbex: Fix potential HTW race on TLBL/M/S handlers

commit 070e76cb3ffe43f6855492e77c96680c562598f0 upstream.

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: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8599/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/mm/tlbex.c