aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-08-09 15:38:43 -0400
committerChris Metcalf <cmetcalf@tilera.com>2013-08-30 11:56:11 -0400
commitd4d9eab4ade468b6a97b6853fdd72e8f21474324 (patch)
treecc7ebd45a2fb7f4abc1bde7d362c8f174016dfa2 /arch/tile
parent3fa17c395bb0c358745fbe0c8aa039d6cdac1735 (diff)
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>
Diffstat (limited to 'arch/tile')
-rw-r--r--arch/tile/include/asm/futex.h1
-rw-r--r--arch/tile/include/asm/uaccess.h6
-rw-r--r--arch/tile/lib/atomic_asm_32.S1
-rw-r--r--arch/tile/lib/memcpy_32.S2
-rw-r--r--arch/tile/lib/memcpy_user_64.c2
-rw-r--r--arch/tile/lib/usercopy_32.S6
-rw-r--r--arch/tile/lib/usercopy_64.S6
7 files changed, 24 insertions, 0 deletions
diff --git a/arch/tile/include/asm/futex.h b/arch/tile/include/asm/futex.h
index 5909ac3d7218..1a6ef1b69cb1 100644
--- a/arch/tile/include/asm/futex.h
+++ b/arch/tile/include/asm/futex.h
@@ -43,6 +43,7 @@
43 ".pushsection .fixup,\"ax\"\n" \ 43 ".pushsection .fixup,\"ax\"\n" \
44 "0: { movei %0, %5; j 9f }\n" \ 44 "0: { movei %0, %5; j 9f }\n" \
45 ".section __ex_table,\"a\"\n" \ 45 ".section __ex_table,\"a\"\n" \
46 ".align 8\n" \
46 ".quad 1b, 0b\n" \ 47 ".quad 1b, 0b\n" \
47 ".popsection\n" \ 48 ".popsection\n" \
48 "9:" \ 49 "9:" \
diff --git a/arch/tile/include/asm/uaccess.h b/arch/tile/include/asm/uaccess.h
index f68503f8e0aa..b6cde3209b96 100644
--- a/arch/tile/include/asm/uaccess.h
+++ b/arch/tile/include/asm/uaccess.h
@@ -127,8 +127,10 @@ extern int fixup_exception(struct pt_regs *regs);
127 127
128#ifdef __LP64__ 128#ifdef __LP64__
129#define _ASM_PTR ".quad" 129#define _ASM_PTR ".quad"
130#define _ASM_ALIGN ".align 8"
130#else 131#else
131#define _ASM_PTR ".long" 132#define _ASM_PTR ".long"
133#define _ASM_ALIGN ".align 4"
132#endif 134#endif
133 135
134#define __get_user_asm(OP, x, ptr, ret) \ 136#define __get_user_asm(OP, x, ptr, ret) \
@@ -137,6 +139,7 @@ extern int fixup_exception(struct pt_regs *regs);
137 "0: { movei %1, 0; movei %0, %3 }\n" \ 139 "0: { movei %1, 0; movei %0, %3 }\n" \
138 "j 9f\n" \ 140 "j 9f\n" \
139 ".section __ex_table,\"a\"\n" \ 141 ".section __ex_table,\"a\"\n" \
142 _ASM_ALIGN "\n" \
140 _ASM_PTR " 1b, 0b\n" \ 143 _ASM_PTR " 1b, 0b\n" \
141 ".popsection\n" \ 144 ".popsection\n" \
142 "9:" \ 145 "9:" \
@@ -168,6 +171,7 @@ extern int fixup_exception(struct pt_regs *regs);
168 "0: { movei %1, 0; movei %2, 0 }\n" \ 171 "0: { movei %1, 0; movei %2, 0 }\n" \
169 "{ movei %0, %4; j 9f }\n" \ 172 "{ movei %0, %4; j 9f }\n" \
170 ".section __ex_table,\"a\"\n" \ 173 ".section __ex_table,\"a\"\n" \
174 ".align 4\n" \
171 ".word 1b, 0b\n" \ 175 ".word 1b, 0b\n" \
172 ".word 2b, 0b\n" \ 176 ".word 2b, 0b\n" \
173 ".popsection\n" \ 177 ".popsection\n" \
@@ -224,6 +228,7 @@ extern int __get_user_bad(void)
224 ".pushsection .fixup,\"ax\"\n" \ 228 ".pushsection .fixup,\"ax\"\n" \
225 "0: { movei %0, %3; j 9f }\n" \ 229 "0: { movei %0, %3; j 9f }\n" \
226 ".section __ex_table,\"a\"\n" \ 230 ".section __ex_table,\"a\"\n" \
231 _ASM_ALIGN "\n" \
227 _ASM_PTR " 1b, 0b\n" \ 232 _ASM_PTR " 1b, 0b\n" \
228 ".popsection\n" \ 233 ".popsection\n" \
229 "9:" \ 234 "9:" \
@@ -248,6 +253,7 @@ extern int __get_user_bad(void)
248 ".pushsection .fixup,\"ax\"\n" \ 253 ".pushsection .fixup,\"ax\"\n" \
249 "0: { movei %0, %4; j 9f }\n" \ 254 "0: { movei %0, %4; j 9f }\n" \
250 ".section __ex_table,\"a\"\n" \ 255 ".section __ex_table,\"a\"\n" \
256 ".align 4\n" \
251 ".word 1b, 0b\n" \ 257 ".word 1b, 0b\n" \
252 ".word 2b, 0b\n" \ 258 ".word 2b, 0b\n" \
253 ".popsection\n" \ 259 ".popsection\n" \
diff --git a/arch/tile/lib/atomic_asm_32.S b/arch/tile/lib/atomic_asm_32.S
index 30638042691d..6bda3132cd61 100644
--- a/arch/tile/lib/atomic_asm_32.S
+++ b/arch/tile/lib/atomic_asm_32.S
@@ -164,6 +164,7 @@ STD_ENTRY_SECTION(__atomic\name, .text.atomic)
164 STD_ENDPROC(__atomic\name) 164 STD_ENDPROC(__atomic\name)
165 .ifc \bitwidth,32 165 .ifc \bitwidth,32
166 .pushsection __ex_table,"a" 166 .pushsection __ex_table,"a"
167 .align 4
167 .word 1b, __atomic\name 168 .word 1b, __atomic\name
168 .word 2b, __atomic\name 169 .word 2b, __atomic\name
169 .word __atomic\name, __atomic_bad_address 170 .word __atomic\name, __atomic_bad_address
diff --git a/arch/tile/lib/memcpy_32.S b/arch/tile/lib/memcpy_32.S
index 2a419a6122db..8ba7626cfeb1 100644
--- a/arch/tile/lib/memcpy_32.S
+++ b/arch/tile/lib/memcpy_32.S
@@ -44,6 +44,7 @@
44 */ 44 */
45#define EX \ 45#define EX \
46 .pushsection __ex_table, "a"; \ 46 .pushsection __ex_table, "a"; \
47 .align 4; \
47 .word 9f, memcpy_common_fixup; \ 48 .word 9f, memcpy_common_fixup; \
48 .popsection; \ 49 .popsection; \
49 9 50 9
@@ -614,5 +615,6 @@ memcpy_fixup_loop:
614 .size memcpy_common_fixup, . - memcpy_common_fixup 615 .size memcpy_common_fixup, . - memcpy_common_fixup
615 616
616 .section __ex_table,"a" 617 .section __ex_table,"a"
618 .align 4
617 .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder 619 .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder
618 .word .Lctu, .Lcopy_to_user_fixup_done 620 .word .Lctu, .Lcopy_to_user_fixup_done
diff --git a/arch/tile/lib/memcpy_user_64.c b/arch/tile/lib/memcpy_user_64.c
index 37440caa7370..88c7016492c4 100644
--- a/arch/tile/lib/memcpy_user_64.c
+++ b/arch/tile/lib/memcpy_user_64.c
@@ -31,6 +31,7 @@
31 ".pushsection .coldtext.memcpy,\"ax\";" \ 31 ".pushsection .coldtext.memcpy,\"ax\";" \
32 "2: { move r0, %2; jrp lr };" \ 32 "2: { move r0, %2; jrp lr };" \
33 ".section __ex_table,\"a\";" \ 33 ".section __ex_table,\"a\";" \
34 ".align 8;" \
34 ".quad 1b, 2b;" \ 35 ".quad 1b, 2b;" \
35 ".popsection" \ 36 ".popsection" \
36 : "=m" (*(p)) : "r" (v), "r" (n)); \ 37 : "=m" (*(p)) : "r" (v), "r" (n)); \
@@ -43,6 +44,7 @@
43 ".pushsection .coldtext.memcpy,\"ax\";" \ 44 ".pushsection .coldtext.memcpy,\"ax\";" \
44 "2: { move r0, %2; jrp lr };" \ 45 "2: { move r0, %2; jrp lr };" \
45 ".section __ex_table,\"a\";" \ 46 ".section __ex_table,\"a\";" \
47 ".align 8;" \
46 ".quad 1b, 2b;" \ 48 ".quad 1b, 2b;" \
47 ".popsection" \ 49 ".popsection" \
48 : "=r" (__v) : "m" (*(p)), "r" (n)); \ 50 : "=r" (__v) : "m" (*(p)), "r" (n)); \
diff --git a/arch/tile/lib/usercopy_32.S b/arch/tile/lib/usercopy_32.S
index 21ffa88ffe5f..bb4c127be6e9 100644
--- a/arch/tile/lib/usercopy_32.S
+++ b/arch/tile/lib/usercopy_32.S
@@ -36,6 +36,7 @@ strnlen_user_fault:
36 { move r0, zero; jrp lr } 36 { move r0, zero; jrp lr }
37 ENDPROC(strnlen_user_fault) 37 ENDPROC(strnlen_user_fault)
38 .section __ex_table,"a" 38 .section __ex_table,"a"
39 .align 4
39 .word 1b, strnlen_user_fault 40 .word 1b, strnlen_user_fault
40 .popsection 41 .popsection
41 42
@@ -59,6 +60,7 @@ strncpy_from_user_fault:
59 { movei r0, -EFAULT; jrp lr } 60 { movei r0, -EFAULT; jrp lr }
60 ENDPROC(strncpy_from_user_fault) 61 ENDPROC(strncpy_from_user_fault)
61 .section __ex_table,"a" 62 .section __ex_table,"a"
63 .align 4
62 .word 1b, strncpy_from_user_fault 64 .word 1b, strncpy_from_user_fault
63 .popsection 65 .popsection
64 66
@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm)
77 bnzt r1, 1b 79 bnzt r1, 1b
782: { move r0, r1; jrp lr } 802: { move r0, r1; jrp lr }
79 .pushsection __ex_table,"a" 81 .pushsection __ex_table,"a"
82 .align 4
80 .word 1b, 2b 83 .word 1b, 2b
81 .popsection 84 .popsection
82 85
@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm)
862: { move r0, r1; jrp lr } 892: { move r0, r1; jrp lr }
87 STD_ENDPROC(clear_user_asm) 90 STD_ENDPROC(clear_user_asm)
88 .pushsection __ex_table,"a" 91 .pushsection __ex_table,"a"
92 .align 4
89 .word 1b, 2b 93 .word 1b, 2b
90 .popsection 94 .popsection
91 95
@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm)
1052: { move r0, r1; jrp lr } 1092: { move r0, r1; jrp lr }
106 STD_ENDPROC(flush_user_asm) 110 STD_ENDPROC(flush_user_asm)
107 .pushsection __ex_table,"a" 111 .pushsection __ex_table,"a"
112 .align 4
108 .word 1b, 2b 113 .word 1b, 2b
109 .popsection 114 .popsection
110 115
@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm)
1242: { move r0, r1; jrp lr } 1292: { move r0, r1; jrp lr }
125 STD_ENDPROC(finv_user_asm) 130 STD_ENDPROC(finv_user_asm)
126 .pushsection __ex_table,"a" 131 .pushsection __ex_table,"a"
132 .align 4
127 .word 1b, 2b 133 .word 1b, 2b
128 .popsection 134 .popsection
diff --git a/arch/tile/lib/usercopy_64.S b/arch/tile/lib/usercopy_64.S
index f248d3196e5c..0d94844eb218 100644
--- a/arch/tile/lib/usercopy_64.S
+++ b/arch/tile/lib/usercopy_64.S
@@ -36,6 +36,7 @@ strnlen_user_fault:
36 { move r0, zero; jrp lr } 36 { move r0, zero; jrp lr }
37 ENDPROC(strnlen_user_fault) 37 ENDPROC(strnlen_user_fault)
38 .section __ex_table,"a" 38 .section __ex_table,"a"
39 .align 8
39 .quad 1b, strnlen_user_fault 40 .quad 1b, strnlen_user_fault
40 .popsection 41 .popsection
41 42
@@ -59,6 +60,7 @@ strncpy_from_user_fault:
59 { movei r0, -EFAULT; jrp lr } 60 { movei r0, -EFAULT; jrp lr }
60 ENDPROC(strncpy_from_user_fault) 61 ENDPROC(strncpy_from_user_fault)
61 .section __ex_table,"a" 62 .section __ex_table,"a"
63 .align 8
62 .quad 1b, strncpy_from_user_fault 64 .quad 1b, strncpy_from_user_fault
63 .popsection 65 .popsection
64 66
@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm)
77 bnezt r1, 1b 79 bnezt r1, 1b
782: { move r0, r1; jrp lr } 802: { move r0, r1; jrp lr }
79 .pushsection __ex_table,"a" 81 .pushsection __ex_table,"a"
82 .align 8
80 .quad 1b, 2b 83 .quad 1b, 2b
81 .popsection 84 .popsection
82 85
@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm)
862: { move r0, r1; jrp lr } 892: { move r0, r1; jrp lr }
87 STD_ENDPROC(clear_user_asm) 90 STD_ENDPROC(clear_user_asm)
88 .pushsection __ex_table,"a" 91 .pushsection __ex_table,"a"
92 .align 8
89 .quad 1b, 2b 93 .quad 1b, 2b
90 .popsection 94 .popsection
91 95
@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm)
1052: { move r0, r1; jrp lr } 1092: { move r0, r1; jrp lr }
106 STD_ENDPROC(flush_user_asm) 110 STD_ENDPROC(flush_user_asm)
107 .pushsection __ex_table,"a" 111 .pushsection __ex_table,"a"
112 .align 8
108 .quad 1b, 2b 113 .quad 1b, 2b
109 .popsection 114 .popsection
110 115
@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm)
1242: { move r0, r1; jrp lr } 1292: { move r0, r1; jrp lr }
125 STD_ENDPROC(finv_user_asm) 130 STD_ENDPROC(finv_user_asm)
126 .pushsection __ex_table,"a" 131 .pushsection __ex_table,"a"
132 .align 8
127 .quad 1b, 2b 133 .quad 1b, 2b
128 .popsection 134 .popsection