]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sparc64: Fix regression in non-hypervisor TLB flush xcall
authorJames Clarke <jrtc27@jrtc27.com>
Wed, 29 May 2019 21:31:31 +0000 (22:31 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jun 2019 05:13:40 +0000 (22:13 -0700)
Previously, %g2 would end up with the value PAGE_SIZE, but after the
commit mentioned below it ends up with the value 1 due to being reused
for a different purpose. We need it to be PAGE_SIZE as we use it to step
through pages in our demap loop, otherwise we set different flags in the
low 12 bits of the address written to, thereby doing things other than a
nucleus page flush.

Fixes: a74ad5e660a9 ("sparc64: Handle extremely large kernel TLB range flushes more gracefully.")
Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/ultra.S

index d245f89d139528f049f2c8d596729974fb7e2020..d220b6848746c5ce46095fd2fb4aae4669ccb9ea 100644 (file)
@@ -587,7 +587,7 @@ xcall_flush_tlb_kernel_range:       /* 44 insns */
        sub             %g7, %g1, %g3
        srlx            %g3, 18, %g2
        brnz,pn         %g2, 2f
-        add            %g2, 1, %g2
+        sethi          %hi(PAGE_SIZE), %g2
        sub             %g3, %g2, %g3
        or              %g1, 0x20, %g1          ! Nucleus
 1:     stxa            %g0, [%g1 + %g3] ASI_DMMU_DEMAP
@@ -751,7 +751,7 @@ __cheetah_xcall_flush_tlb_kernel_range:     /* 44 insns */
        sub             %g7, %g1, %g3
        srlx            %g3, 18, %g2
        brnz,pn         %g2, 2f
-        add            %g2, 1, %g2
+        sethi          %hi(PAGE_SIZE), %g2
        sub             %g3, %g2, %g3
        or              %g1, 0x20, %g1          ! Nucleus
 1:     stxa            %g0, [%g1 + %g3] ASI_DMMU_DEMAP