linux-brain/arch/parisc
John David Anglin 12efc91591 parisc: Fix ordering of cache and TLB flushes
commit 0adb24e03a upstream.

The change to flush_kernel_vmap_range() wasn't sufficient to avoid the
SMP stalls.  The problem is some drivers call these routines with
interrupts disabled.  Interrupts need to be enabled for flush_tlb_all()
and flush_cache_all() to work.  This version adds checks to ensure
interrupts are not disabled before calling routines that need IPI
interrupts.  When interrupts are disabled, we now drop into slower code.

The attached change fixes the ordering of cache and TLB flushes in
several cases.  When we flush the cache using the existing PTE/TLB
entries, we need to flush the TLB after doing the cache flush.  We don't
need to do this when we flush the entire instruction and data caches as
these flushes don't use the existing TLB entries.  The same is true for
tmpalias region flushes.

The flush_kernel_vmap_range() and invalidate_kernel_vmap_range()
routines have been updated.

Secondly, we added a new purge_kernel_dcache_range_asm() routine to
pacache.S and use it in invalidate_kernel_vmap_range().  Nominally,
purges are faster than flushes as the cache lines don't have to be
written back to memory.

Hopefully, this is sufficient to resolve the remaining problems due to
cache speculation.  So far, testing indicates that this is the case.  I
did work up a patch using tmpalias flushes, but there is a performance
hit because we need the physical address for each page, and we also need
to sequence access to the tmpalias flush code.  This increases the
probability of stalls.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-11 16:21:28 +01:00
..
configs mm/usercopy: get rid of CONFIG_DEBUG_STRICT_USER_COPY_CHECKS 2016-08-30 10:10:21 -07:00
include parisc: Fix ordering of cache and TLB flushes 2018-03-11 16:21:28 +01:00
kernel parisc: Fix ordering of cache and TLB flushes 2018-03-11 16:21:28 +01:00
lib parisc: fix bugs in pa_memcpy 2017-04-21 09:31:20 +02:00
math-emu parisc: Fix typo in fpudispatch.c 2016-05-22 22:29:07 +02:00
mm parisc: Report SIGSEGV instead of SIGBUS when running out of stack 2017-07-21 07:42:20 +02:00
oprofile oprofile: more whitespace fixes 2008-10-15 20:55:51 +02:00
Kconfig parisc: Switch to generic sched_clock implementation 2016-11-25 12:31:58 +01:00
Kconfig.debug parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
Makefile parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
defpalo.conf parisc: switch to gzip-compressed vmlinuz kernel 2013-07-09 22:09:20 +02:00
install.sh parisc: make "make install" not depend on vmlinux 2013-11-07 22:28:06 +01:00
nm Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00