]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/sparc64-fix-regression-in-non-hypervisor-tlb-flush-xcall.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / queue-4.19 / sparc64-fix-regression-in-non-hypervisor-tlb-flush-xcall.patch
1 From d3c976c14ad8af421134c428b0a89ff8dd3bd8f8 Mon Sep 17 00:00:00 2001
2 From: James Clarke <jrtc27@jrtc27.com>
3 Date: Wed, 29 May 2019 22:31:31 +0100
4 Subject: sparc64: Fix regression in non-hypervisor TLB flush xcall
5
6 From: James Clarke <jrtc27@jrtc27.com>
7
8 commit d3c976c14ad8af421134c428b0a89ff8dd3bd8f8 upstream.
9
10 Previously, %g2 would end up with the value PAGE_SIZE, but after the
11 commit mentioned below it ends up with the value 1 due to being reused
12 for a different purpose. We need it to be PAGE_SIZE as we use it to step
13 through pages in our demap loop, otherwise we set different flags in the
14 low 12 bits of the address written to, thereby doing things other than a
15 nucleus page flush.
16
17 Fixes: a74ad5e660a9 ("sparc64: Handle extremely large kernel TLB range flushes more gracefully.")
18 Reported-by: Meelis Roos <mroos@linux.ee>
19 Tested-by: Meelis Roos <mroos@linux.ee>
20 Signed-off-by: James Clarke <jrtc27@jrtc27.com>
21 Signed-off-by: David S. Miller <davem@davemloft.net>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 arch/sparc/mm/ultra.S | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28 --- a/arch/sparc/mm/ultra.S
29 +++ b/arch/sparc/mm/ultra.S
30 @@ -587,7 +587,7 @@ xcall_flush_tlb_kernel_range: /* 44 insn
31 sub %g7, %g1, %g3
32 srlx %g3, 18, %g2
33 brnz,pn %g2, 2f
34 - add %g2, 1, %g2
35 + sethi %hi(PAGE_SIZE), %g2
36 sub %g3, %g2, %g3
37 or %g1, 0x20, %g1 ! Nucleus
38 1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP
39 @@ -751,7 +751,7 @@ __cheetah_xcall_flush_tlb_kernel_range:
40 sub %g7, %g1, %g3
41 srlx %g3, 18, %g2
42 brnz,pn %g2, 2f
43 - add %g2, 1, %g2
44 + sethi %hi(PAGE_SIZE), %g2
45 sub %g3, %g2, %g3
46 or %g1, 0x20, %g1 ! Nucleus
47 1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP