]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.19/parisc-add-memory-clobber-to-tlb-purges.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.19 / parisc-add-memory-clobber-to-tlb-purges.patch
1 From 44224bdb99150ad17cf394973b25736cb92c246a Mon Sep 17 00:00:00 2001
2 From: John David Anglin <dave.anglin@bell.net>
3 Date: Sun, 21 Apr 2019 19:47:17 -0400
4 Subject: parisc: Add memory clobber to TLB purges
5
6 From: John David Anglin <dave.anglin@bell.net>
7
8 commit 44224bdb99150ad17cf394973b25736cb92c246a upstream.
9
10 The pdtlb and pitlb instructions are strongly ordered. The asms invoking
11 these instructions should be compiler memory barriers to ensure the
12 compiler doesn't reorder memory operations around these instructions.
13
14 Signed-off-by: John David Anglin <dave.anglin@bell.net>
15 CC: stable@vger.kernel.org # v4.20+
16 Fixes: 3847dab77421 ("parisc: Add alternative coding infrastructure")
17 Signed-off-by: Helge Deller <deller@gmx.de>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 arch/parisc/include/asm/cache.h | 6 +++---
22 1 file changed, 3 insertions(+), 3 deletions(-)
23
24 --- a/arch/parisc/include/asm/cache.h
25 +++ b/arch/parisc/include/asm/cache.h
26 @@ -44,14 +44,14 @@ void parisc_setup_cache_timing(void);
27
28 #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" \
29 ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
30 - : : "r" (addr))
31 + : : "r" (addr) : "memory")
32 #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" \
33 ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
34 ALTERNATIVE(ALT_COND_NO_SPLIT_TLB, INSN_NOP) \
35 - : : "r" (addr))
36 + : : "r" (addr) : "memory")
37 #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" \
38 ALTERNATIVE(ALT_COND_NO_SMP, INSN_PxTLB) \
39 - : : "r" (addr))
40 + : : "r" (addr) : "memory")
41
42 #define asm_io_fdc(addr) asm volatile("fdc %%r0(%0)" \
43 ALTERNATIVE(ALT_COND_NO_DCACHE, INSN_NOP) \