]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.4/sparc64-fix-regression-in-non-hypervisor-tlb-flush-xcall.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / sparc64-fix-regression-in-non-hypervisor-tlb-flush-xcall.patch
CommitLineData
96b04058
GKH
1From d3c976c14ad8af421134c428b0a89ff8dd3bd8f8 Mon Sep 17 00:00:00 2001
2From: James Clarke <jrtc27@jrtc27.com>
3Date: Wed, 29 May 2019 22:31:31 +0100
4Subject: sparc64: Fix regression in non-hypervisor TLB flush xcall
5
6From: James Clarke <jrtc27@jrtc27.com>
7
8commit d3c976c14ad8af421134c428b0a89ff8dd3bd8f8 upstream.
9
10Previously, %g2 would end up with the value PAGE_SIZE, but after the
11commit mentioned below it ends up with the value 1 due to being reused
12for a different purpose. We need it to be PAGE_SIZE as we use it to step
13through pages in our demap loop, otherwise we set different flags in the
14low 12 bits of the address written to, thereby doing things other than a
15nucleus page flush.
16
17Fixes: a74ad5e660a9 ("sparc64: Handle extremely large kernel TLB range flushes more gracefully.")
18Reported-by: Meelis Roos <mroos@linux.ee>
19Tested-by: Meelis Roos <mroos@linux.ee>
20Signed-off-by: James Clarke <jrtc27@jrtc27.com>
21Signed-off-by: David S. Miller <davem@davemloft.net>
22Signed-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@@ -586,7 +586,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@@ -750,7 +750,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