Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tile: use proper .align directives on __ex_table sections

This may fix a reported bug where an R_TILEGX_64 in a module was not
pointing to an aligned address.

Reported-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

+24
+1
arch/tile/include/asm/futex.h
··· 43 43 ".pushsection .fixup,\"ax\"\n" \ 44 44 "0: { movei %0, %5; j 9f }\n" \ 45 45 ".section __ex_table,\"a\"\n" \ 46 + ".align 8\n" \ 46 47 ".quad 1b, 0b\n" \ 47 48 ".popsection\n" \ 48 49 "9:" \
+6
arch/tile/include/asm/uaccess.h
··· 127 127 128 128 #ifdef __LP64__ 129 129 #define _ASM_PTR ".quad" 130 + #define _ASM_ALIGN ".align 8" 130 131 #else 131 132 #define _ASM_PTR ".long" 133 + #define _ASM_ALIGN ".align 4" 132 134 #endif 133 135 134 136 #define __get_user_asm(OP, x, ptr, ret) \ ··· 139 137 "0: { movei %1, 0; movei %0, %3 }\n" \ 140 138 "j 9f\n" \ 141 139 ".section __ex_table,\"a\"\n" \ 140 + _ASM_ALIGN "\n" \ 142 141 _ASM_PTR " 1b, 0b\n" \ 143 142 ".popsection\n" \ 144 143 "9:" \ ··· 171 168 "0: { movei %1, 0; movei %2, 0 }\n" \ 172 169 "{ movei %0, %4; j 9f }\n" \ 173 170 ".section __ex_table,\"a\"\n" \ 171 + ".align 4\n" \ 174 172 ".word 1b, 0b\n" \ 175 173 ".word 2b, 0b\n" \ 176 174 ".popsection\n" \ ··· 228 224 ".pushsection .fixup,\"ax\"\n" \ 229 225 "0: { movei %0, %3; j 9f }\n" \ 230 226 ".section __ex_table,\"a\"\n" \ 227 + _ASM_ALIGN "\n" \ 231 228 _ASM_PTR " 1b, 0b\n" \ 232 229 ".popsection\n" \ 233 230 "9:" \ ··· 253 248 ".pushsection .fixup,\"ax\"\n" \ 254 249 "0: { movei %0, %4; j 9f }\n" \ 255 250 ".section __ex_table,\"a\"\n" \ 251 + ".align 4\n" \ 256 252 ".word 1b, 0b\n" \ 257 253 ".word 2b, 0b\n" \ 258 254 ".popsection\n" \
+1
arch/tile/lib/atomic_asm_32.S
··· 164 164 STD_ENDPROC(__atomic\name) 165 165 .ifc \bitwidth,32 166 166 .pushsection __ex_table,"a" 167 + .align 4 167 168 .word 1b, __atomic\name 168 169 .word 2b, __atomic\name 169 170 .word __atomic\name, __atomic_bad_address
+2
arch/tile/lib/memcpy_32.S
··· 44 44 */ 45 45 #define EX \ 46 46 .pushsection __ex_table, "a"; \ 47 + .align 4; \ 47 48 .word 9f, memcpy_common_fixup; \ 48 49 .popsection; \ 49 50 9 ··· 615 614 .size memcpy_common_fixup, . - memcpy_common_fixup 616 615 617 616 .section __ex_table,"a" 617 + .align 4 618 618 .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder 619 619 .word .Lctu, .Lcopy_to_user_fixup_done
+2
arch/tile/lib/memcpy_user_64.c
··· 31 31 ".pushsection .coldtext.memcpy,\"ax\";" \ 32 32 "2: { move r0, %2; jrp lr };" \ 33 33 ".section __ex_table,\"a\";" \ 34 + ".align 8;" \ 34 35 ".quad 1b, 2b;" \ 35 36 ".popsection" \ 36 37 : "=m" (*(p)) : "r" (v), "r" (n)); \ ··· 44 43 ".pushsection .coldtext.memcpy,\"ax\";" \ 45 44 "2: { move r0, %2; jrp lr };" \ 46 45 ".section __ex_table,\"a\";" \ 46 + ".align 8;" \ 47 47 ".quad 1b, 2b;" \ 48 48 ".popsection" \ 49 49 : "=r" (__v) : "m" (*(p)), "r" (n)); \
+6
arch/tile/lib/usercopy_32.S
··· 36 36 { move r0, zero; jrp lr } 37 37 ENDPROC(strnlen_user_fault) 38 38 .section __ex_table,"a" 39 + .align 4 39 40 .word 1b, strnlen_user_fault 40 41 .popsection 41 42 ··· 60 59 { movei r0, -EFAULT; jrp lr } 61 60 ENDPROC(strncpy_from_user_fault) 62 61 .section __ex_table,"a" 62 + .align 4 63 63 .word 1b, strncpy_from_user_fault 64 64 .popsection 65 65 ··· 79 77 bnzt r1, 1b 80 78 2: { move r0, r1; jrp lr } 81 79 .pushsection __ex_table,"a" 80 + .align 4 82 81 .word 1b, 2b 83 82 .popsection 84 83 ··· 89 86 2: { move r0, r1; jrp lr } 90 87 STD_ENDPROC(clear_user_asm) 91 88 .pushsection __ex_table,"a" 89 + .align 4 92 90 .word 1b, 2b 93 91 .popsection 94 92 ··· 109 105 2: { move r0, r1; jrp lr } 110 106 STD_ENDPROC(flush_user_asm) 111 107 .pushsection __ex_table,"a" 108 + .align 4 112 109 .word 1b, 2b 113 110 .popsection 114 111 ··· 129 124 2: { move r0, r1; jrp lr } 130 125 STD_ENDPROC(finv_user_asm) 131 126 .pushsection __ex_table,"a" 127 + .align 4 132 128 .word 1b, 2b 133 129 .popsection
+6
arch/tile/lib/usercopy_64.S
··· 36 36 { move r0, zero; jrp lr } 37 37 ENDPROC(strnlen_user_fault) 38 38 .section __ex_table,"a" 39 + .align 8 39 40 .quad 1b, strnlen_user_fault 40 41 .popsection 41 42 ··· 60 59 { movei r0, -EFAULT; jrp lr } 61 60 ENDPROC(strncpy_from_user_fault) 62 61 .section __ex_table,"a" 62 + .align 8 63 63 .quad 1b, strncpy_from_user_fault 64 64 .popsection 65 65 ··· 79 77 bnezt r1, 1b 80 78 2: { move r0, r1; jrp lr } 81 79 .pushsection __ex_table,"a" 80 + .align 8 82 81 .quad 1b, 2b 83 82 .popsection 84 83 ··· 89 86 2: { move r0, r1; jrp lr } 90 87 STD_ENDPROC(clear_user_asm) 91 88 .pushsection __ex_table,"a" 89 + .align 8 92 90 .quad 1b, 2b 93 91 .popsection 94 92 ··· 109 105 2: { move r0, r1; jrp lr } 110 106 STD_ENDPROC(flush_user_asm) 111 107 .pushsection __ex_table,"a" 108 + .align 8 112 109 .quad 1b, 2b 113 110 .popsection 114 111 ··· 129 124 2: { move r0, r1; jrp lr } 130 125 STD_ENDPROC(finv_user_asm) 131 126 .pushsection __ex_table,"a" 127 + .align 8 132 128 .quad 1b, 2b 133 129 .popsection