]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
MIPS: Apply `.insn' to fixup labels throughout
authorMaciej W. Rozycki <macro@codesourcery.com>
Sat, 15 Nov 2014 22:09:31 +0000 (22:09 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 24 Nov 2014 06:45:36 +0000 (07:45 +0100)
Fix the issue with the ISA bit being lost in fixups that jump to labels
placed just before a section switch.  Such a switch leads to the ISA bit
being lost, because GAS concludes there is no code that follows and
therefore the label refers to data.  Use the `.insn' pseudo-op to
convince the tool this is not the case.

This lack of label annotation leads to microMIPS compilation errors
like:

mips-linux-gnu-ld: arch/mips/built-in.o: .fixup+0x3b8: Unsupported jump between ISA modes; consider recompiling with interlinking enabled.
mips-linux-gnu-ld: final link failed: Bad value

Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com>
Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8483/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/futex.h
arch/mips/include/asm/paccess.h
arch/mips/kernel/syscall.c

index d0177bf915bb359fd39814cd3b23dad412ee7ee7..ef9987a61d88c62e79e38e3c406a3bbcc42e1a23 100644 (file)
@@ -33,6 +33,7 @@
                "       beqzl   $1, 1b                          \n"     \
                __WEAK_LLSC_MB                                          \
                "3:                                             \n"     \
+               "       .insn                                   \n"     \
                "       .set    pop                             \n"     \
                "       .set    mips0                           \n"     \
                "       .section .fixup,\"ax\"                  \n"     \
@@ -61,6 +62,7 @@
                "       beqz    $1, 1b                          \n"     \
                __WEAK_LLSC_MB                                          \
                "3:                                             \n"     \
+               "       .insn                                   \n"     \
                "       .set    pop                             \n"     \
                "       .set    mips0                           \n"     \
                "       .section .fixup,\"ax\"                  \n"     \
@@ -162,6 +164,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
                "       beqzl   $1, 1b                                  \n"
                __WEAK_LLSC_MB
                "3:                                                     \n"
+               "       .insn                                           \n"
                "       .set    pop                                     \n"
                "       .section .fixup,\"ax\"                          \n"
                "4:     li      %0, %6                                  \n"
@@ -190,6 +193,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
                "       beqz    $1, 1b                                  \n"
                __WEAK_LLSC_MB
                "3:                                                     \n"
+               "       .insn                                           \n"
                "       .set    pop                                     \n"
                "       .section .fixup,\"ax\"                          \n"
                "4:     li      %0, %6                                  \n"
index 2474fc5d1751cedcf3f0caf3004d4dec4ea28be1..af81ab0da55fc2b4f657a90fdcd744a54220b1e9 100644 (file)
@@ -56,6 +56,7 @@ struct __large_pstruct { unsigned long buf[100]; };
        "1:\t" insn "\t%1,%2\n\t"                                       \
        "move\t%0,$0\n"                                                 \
        "2:\n\t"                                                        \
+       ".insn\n\t"                                                     \
        ".section\t.fixup,\"ax\"\n"                                     \
        "3:\tli\t%0,%3\n\t"                                             \
        "move\t%1,$0\n\t"                                               \
@@ -94,6 +95,7 @@ extern void __get_dbe_unknown(void);
        "1:\t" insn "\t%1,%2\n\t"                                       \
        "move\t%0,$0\n"                                                 \
        "2:\n\t"                                                        \
+       ".insn\n\t"                                                     \
        ".section\t.fixup,\"ax\"\n"                                     \
        "3:\tli\t%0,%3\n\t"                                             \
        "j\t2b\n\t"                                                     \
index 4a4f9dda5658af8297b66981532c01f288609306..604b558809c4c4474bfd953507ca7e54af5e9eca 100644 (file)
@@ -117,6 +117,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
                "2:     sc      %[tmp], (%[addr])                       \n"
                "       beqzl   %[tmp], 1b                              \n"
                "3:                                                     \n"
+               "       .insn                                           \n"
                "       .section .fixup,\"ax\"                          \n"
                "4:     li      %[err], %[efault]                       \n"
                "       j       3b                                      \n"
@@ -142,6 +143,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
                "2:     sc      %[tmp], (%[addr])                       \n"
                "       bnez    %[tmp], 4f                              \n"
                "3:                                                     \n"
+               "       .insn                                           \n"
                "       .subsection 2                                   \n"
                "4:     b       1b                                      \n"
                "       .previous                                       \n"