Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=52eb053b7191f1d3017a56e921753e3097876c47
Commit:     52eb053b7191f1d3017a56e921753e3097876c47
Parent:     d6898556e90ba9842e59ac9c2425b42ea33019b4
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 30 21:11:28 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 31 15:30:56 2007 -0700

    [SPARC64]: Fix linkage of enormous kernels.
    
    This was found by make randconfig
    
    If the kernel .text is very large, the .fixup section branches
    are too far away to be relocated correctly.
    
    Use "sethi %hi(label), reg; jmpl reg + %lo(label); %g0" sequence
    instead of the branch to fix this.
    
    There is another case in switch_to() involving a branch, which
    is fixed similarly.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/asm-sparc64/futex.h   |    6 ++++--
 include/asm-sparc64/system.h  |    4 +++-
 include/asm-sparc64/uaccess.h |    6 ++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h
index 876312f..df1097d 100644
--- a/include/asm-sparc64/futex.h
+++ b/include/asm-sparc64/futex.h
@@ -17,7 +17,8 @@
        "3:\n"                                          \
        "       .section .fixup,#alloc,#execinstr\n"    \
        "       .align  4\n"                            \
-       "4:     ba      3b\n"                           \
+       "4:     sethi   %%hi(3b), %0\n"                 \
+       "       jmpl    %0 + %%lo(3b), %%g0\n"          \
        "        mov    %5, %0\n"                       \
        "       .previous\n"                            \
        "       .section __ex_table,\"a\"\n"            \
@@ -91,7 +92,8 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, 
int newval)
        "2:\n"
        "       .section .fixup,#alloc,#execinstr\n"
        "       .align  4\n"
-       "3:     ba      2b\n"
+       "3:     sethi   %%hi(2b), %0\n"
+       "       jmpl    %0 + %%lo(2b), %%g0\n"
        "        mov    %4, %0\n"
        "       .previous\n"
        "       .section __ex_table,\"a\"\n"
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 159e62b..99a669c 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -178,7 +178,9 @@ do {        if (test_thread_flag(TIF_PERFCTR)) {            
                \
        "ldx    [%%g6 + %9], %%g4\n\t"                                  \
        "brz,pt %%o7, 1f\n\t"                                           \
        " mov   %%g7, %0\n\t"                                           \
-       "b,a ret_from_syscall\n\t"                                      \
+       "sethi  %%hi(ret_from_syscall), %%g1\n\t"                       \
+       "jmpl   %%g1 + %%lo(ret_from_syscall), %%g0\n\t"                \
+       " nop\n\t"                                                      \
        "1:\n\t"                                                        \
        : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
          "=r" (__local_per_cpu_offset)                                 \
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index afe236b..93720e7 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -123,7 +123,8 @@ __asm__ __volatile__(                                       
                \
        ".section .fixup,#alloc,#execinstr\n\t"                         \
        ".align 4\n"                                                    \
 "3:\n\t"                                                               \
-       "b      2b\n\t"                                                 \
+       "sethi  %%hi(2b), %0\n\t"                                       \
+       "jmpl   %0 + %%lo(2b), %%g0\n\t"                                \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
        ".section __ex_table,\"a\"\n\t"                                 \
@@ -165,8 +166,9 @@ __asm__ __volatile__(                                       
                \
        ".section .fixup,#alloc,#execinstr\n\t"                         \
        ".align 4\n"                                                    \
 "3:\n\t"                                                               \
+       "sethi  %%hi(2b), %0\n\t"                                       \
        "clr    %1\n\t"                                                 \
-       "b      2b\n\t"                                                 \
+       "jmpl   %0 + %%lo(2b), %%g0\n\t"                                \
        " mov   %3, %0\n\n\t"                                           \
        ".previous\n\t"                                                 \
        ".section __ex_table,\"a\"\n\t"                                 \
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to