]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Remove race window in page fault handling
authorLars Persson <lars.persson@axis.com>
Fri, 8 Aug 2014 13:47:48 +0000 (15:47 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 19 Aug 2014 11:31:09 +0000 (13:31 +0200)
commit5e27c4caca045427fbb03ae884e80db700c3efd3
treec15d58946f772c098eb990dbeabda410b245c5dd
parentdb79cd27d91494d70b33d544d2dbf75a9075e75a
MIPS: Remove race window in page fault handling

Multicore MIPSes without I/D hardware coherency suffered from a race
condition in the page fault handler. The page table entry was
published before any pending lazy D-cache flush was committed, hence
it allowed execution of stale page cache data by other VPEs in the
system.

To make the cache handling safe we need to perform flushing already in
the set_pte_at function. MIPSes without coherent I-caches can get a
small increase in flushes due to the unavailability of the execute
flag in set_pte_at.

[ralf@linux-mips.org: outlining set_pte_at() saves a good k in a test
build, so I moved its definition from pgtable.h to cache.c.]

Signed-off-by: Lars Persson <larper@axis.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7511/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/pgtable.h
arch/mips/mm/cache.c