[SPARC64]: Fix branch signedness bug in all code patching.
authorDavid S. Miller <davem@sunset.davemloft.net>
Sun, 12 Feb 2006 07:28:40 +0000 (23:28 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 20 Mar 2006 09:12:29 +0000 (01:12 -0800)
The bug that hit SUN4V TLB patching exists elsewhere.
Make sure we cure all such cases.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/lib/NGpage.S
arch/sparc64/lib/NGpatch.S
arch/sparc64/lib/U3patch.S

index 0e6152c..7d7c3bb 100644 (file)
@@ -75,7 +75,8 @@ NGclear_user_page:    /* %o0=dest, %o1=vaddr */
        or      %g2, %lo(OLD), %g2; \
        sub     %g1, %g2, %g1; \
        sethi   %hi(BRANCH_ALWAYS), %g3; \
-       srl     %g1, 2, %g1; \
+       sll     %g1, 11, %g1; \
+       srl     %g1, 11 + 2, %g1; \
        or      %g3, %lo(BRANCH_ALWAYS), %g3; \
        or      %g3, %g1, %g3; \
        stw     %g3, [%g2]; \
index f13ec9e..3b0674f 100644 (file)
@@ -12,7 +12,8 @@
        or      %g2, %lo(OLD), %g2; \
        sub     %g1, %g2, %g1; \
        sethi   %hi(BRANCH_ALWAYS), %g3; \
-       srl     %g1, 2, %g1; \
+       sll     %g1, 11, %g1; \
+       srl     %g1, 11 + 2, %g1; \
        or      %g3, %lo(BRANCH_ALWAYS), %g3; \
        or      %g3, %g1, %g3; \
        stw     %g3, [%g2]; \
index e2b6c5e..ecc3026 100644 (file)
@@ -12,7 +12,8 @@
        or      %g2, %lo(OLD), %g2; \
        sub     %g1, %g2, %g1; \
        sethi   %hi(BRANCH_ALWAYS), %g3; \
-       srl     %g1, 2, %g1; \
+       sll     %g1, 11, %g1; \
+       srl     %g1, 11 + 2, %g1; \
        or      %g3, %lo(BRANCH_ALWAYS), %g3; \
        or      %g3, %g1, %g3; \
        stw     %g3, [%g2]; \