linux-brain/arch/parisc/kernel
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
..
.gitignore parisc: add arch/parisc/kernel/.gitignore 2008-10-10 16:32:28 +00:00
Makefile parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
asm-offsets.c parisc: Unbreak handling exceptions from kernel modules 2016-04-08 22:14:14 +02:00
audit.c parisc: add kernel audit feature 2013-11-07 22:27:20 +01:00
binfmt_elf32.c parisc: fix redefinition of SET_PERSONALITY 2013-03-02 20:15:28 +01:00
cache.c parisc: Fix ordering of cache and TLB flushes 2018-03-11 16:21:28 +01:00
compat_audit.c parisc: add kernel audit feature 2013-11-07 22:27:20 +01:00
drivers.c parisc: use KERN_CONT when printing device inventory 2016-11-02 23:04:46 +01:00
entry.S parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel 2018-01-10 09:29:54 +01:00
firmware.c parisc: Add break statements to pdc_pat_io_pci_cfg_read() 2016-08-02 16:44:33 +02:00
ftrace.c ftrace: Add return address pointer to ftrace_ret_stack 2016-08-24 12:15:14 +02:00
hardware.c parisc: add serial ports of C8000/1GHz machine to hardware database 2014-07-13 15:51:58 +02:00
head.S parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
hpmc.S parisc: Add cfi_startproc and cfi_endproc to assembly code 2016-10-05 22:54:40 +02:00
inventory.c parisc: Fix printk continuations in system detection 2016-11-22 18:09:33 +01:00
irq.c parisc: Filter out spurious interrupts in PA-RISC irq handler 2015-09-08 15:31:16 +02:00
module.c parisc: Handle R_PARISC_PCREL32 relocations in kernel modules 2016-04-08 22:10:35 +02:00
pa7300lc.c
pacache.S parisc: Fix ordering of cache and TLB flushes 2018-03-11 16:21:28 +01:00
parisc_ksyms.c parisc: Clean up fixup routines for get_user()/put_user() 2017-04-08 09:30:34 +02:00
pci-dma.c parisc: Fix race in pci-dma.c 2016-11-25 12:31:59 +01:00
pci.c parisc: Initialize PCI bridge cache line and default latency 2016-01-12 22:03:21 +01:00
pdc_chassis.c parisc: single_open() leaks 2013-05-05 00:10:41 -04:00
pdc_cons.c parisc: don't use module_init for non-modular core pdc_cons code 2015-06-16 14:12:30 -04:00
perf.c parisc: perf: Fix potential NULL pointer dereference 2017-10-08 10:26:10 +02:00
perf_asm.S Revert "parisc: fix trivial section name warnings" 2008-06-13 10:49:45 -04:00
perf_images.h [PARISC] Use kzalloc and other janitor-style cleanups 2006-01-22 20:26:31 -05:00
process.c parisc: qemu idle sleep support 2018-01-10 09:29:54 +01:00
processor.c parisc: Fix automatic selection of cr16 clocksource 2016-08-20 13:33:51 +02:00
ptrace.c parisc/ptrace: run seccomp after ptrace 2016-06-14 10:54:44 -07:00
real2.S parisc: Add cfi_startproc and cfi_endproc to assembly code 2016-10-05 22:54:40 +02:00
setup.c parisc: Fix races in parisc_setup_cache_timing() 2016-11-25 12:31:57 +01:00
signal.c parisc: Fix syscall restarts 2015-12-21 10:16:18 +01:00
signal32.c parisc: Fix SIGSYS signals in compat case 2016-03-31 12:28:37 +02:00
signal32.h constify copy_siginfo_to_user{,32}() 2013-11-09 00:16:29 -05:00
smp.c parisc: Check return value of smp_boot_one_cpu() 2016-09-20 18:02:36 +02:00
stacktrace.c parisc: add LATENCYTOP_SUPPORT and CONFIG_STACKTRACE_SUPPORT 2009-03-31 02:51:34 +00:00
sys_parisc.c mm: larger stack guard gap, between vmas 2017-06-24 07:11:18 +02:00
sys_parisc32.c parisc: drop unused defines and header includes 2014-07-13 15:56:12 +02:00
syscall.S parisc: Fix validity check of pointer size argument in new CAS implementation 2017-11-30 08:39:08 +00:00
syscall_table.S parisc: use compat_sys_keyctl() 2017-07-21 07:42:20 +02:00
time.c parisc: Mark cr16 clocksource unstable on SMP systems 2017-01-12 11:39:06 +01:00
topology.c parisc: Replace NR_CPUS in parisc code 2009-01-05 19:09:02 +00:00
traps.c parisc: Show trap name in kernel crash 2016-10-11 20:52:47 +02:00
unaligned.c parisc: Move die_if_kernel() prototype into traps.h header 2016-06-05 08:49:01 +02:00
unwind.c parisc: Fix backtrace on PA-RISC 2016-06-04 22:05:07 +02:00
vmlinux.lds.S parisc: Move exception table into read-only section 2016-10-09 13:29:07 +02:00