Commit d4d9eab4 authored by Chris Metcalf's avatar Chris Metcalf

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: default avatarSimon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 3fa17c39
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
".pushsection .fixup,\"ax\"\n" \ ".pushsection .fixup,\"ax\"\n" \
"0: { movei %0, %5; j 9f }\n" \ "0: { movei %0, %5; j 9f }\n" \
".section __ex_table,\"a\"\n" \ ".section __ex_table,\"a\"\n" \
".align 8\n" \
".quad 1b, 0b\n" \ ".quad 1b, 0b\n" \
".popsection\n" \ ".popsection\n" \
"9:" \ "9:" \
......
...@@ -127,8 +127,10 @@ extern int fixup_exception(struct pt_regs *regs); ...@@ -127,8 +127,10 @@ extern int fixup_exception(struct pt_regs *regs);
#ifdef __LP64__ #ifdef __LP64__
#define _ASM_PTR ".quad" #define _ASM_PTR ".quad"
#define _ASM_ALIGN ".align 8"
#else #else
#define _ASM_PTR ".long" #define _ASM_PTR ".long"
#define _ASM_ALIGN ".align 4"
#endif #endif
#define __get_user_asm(OP, x, ptr, ret) \ #define __get_user_asm(OP, x, ptr, ret) \
...@@ -137,6 +139,7 @@ extern int fixup_exception(struct pt_regs *regs); ...@@ -137,6 +139,7 @@ extern int fixup_exception(struct pt_regs *regs);
"0: { movei %1, 0; movei %0, %3 }\n" \ "0: { movei %1, 0; movei %0, %3 }\n" \
"j 9f\n" \ "j 9f\n" \
".section __ex_table,\"a\"\n" \ ".section __ex_table,\"a\"\n" \
_ASM_ALIGN "\n" \
_ASM_PTR " 1b, 0b\n" \ _ASM_PTR " 1b, 0b\n" \
".popsection\n" \ ".popsection\n" \
"9:" \ "9:" \
...@@ -168,6 +171,7 @@ extern int fixup_exception(struct pt_regs *regs); ...@@ -168,6 +171,7 @@ extern int fixup_exception(struct pt_regs *regs);
"0: { movei %1, 0; movei %2, 0 }\n" \ "0: { movei %1, 0; movei %2, 0 }\n" \
"{ movei %0, %4; j 9f }\n" \ "{ movei %0, %4; j 9f }\n" \
".section __ex_table,\"a\"\n" \ ".section __ex_table,\"a\"\n" \
".align 4\n" \
".word 1b, 0b\n" \ ".word 1b, 0b\n" \
".word 2b, 0b\n" \ ".word 2b, 0b\n" \
".popsection\n" \ ".popsection\n" \
...@@ -224,6 +228,7 @@ extern int __get_user_bad(void) ...@@ -224,6 +228,7 @@ extern int __get_user_bad(void)
".pushsection .fixup,\"ax\"\n" \ ".pushsection .fixup,\"ax\"\n" \
"0: { movei %0, %3; j 9f }\n" \ "0: { movei %0, %3; j 9f }\n" \
".section __ex_table,\"a\"\n" \ ".section __ex_table,\"a\"\n" \
_ASM_ALIGN "\n" \
_ASM_PTR " 1b, 0b\n" \ _ASM_PTR " 1b, 0b\n" \
".popsection\n" \ ".popsection\n" \
"9:" \ "9:" \
...@@ -248,6 +253,7 @@ extern int __get_user_bad(void) ...@@ -248,6 +253,7 @@ extern int __get_user_bad(void)
".pushsection .fixup,\"ax\"\n" \ ".pushsection .fixup,\"ax\"\n" \
"0: { movei %0, %4; j 9f }\n" \ "0: { movei %0, %4; j 9f }\n" \
".section __ex_table,\"a\"\n" \ ".section __ex_table,\"a\"\n" \
".align 4\n" \
".word 1b, 0b\n" \ ".word 1b, 0b\n" \
".word 2b, 0b\n" \ ".word 2b, 0b\n" \
".popsection\n" \ ".popsection\n" \
......
...@@ -164,6 +164,7 @@ STD_ENTRY_SECTION(__atomic\name, .text.atomic) ...@@ -164,6 +164,7 @@ STD_ENTRY_SECTION(__atomic\name, .text.atomic)
STD_ENDPROC(__atomic\name) STD_ENDPROC(__atomic\name)
.ifc \bitwidth,32 .ifc \bitwidth,32
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 4
.word 1b, __atomic\name .word 1b, __atomic\name
.word 2b, __atomic\name .word 2b, __atomic\name
.word __atomic\name, __atomic_bad_address .word __atomic\name, __atomic_bad_address
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
*/ */
#define EX \ #define EX \
.pushsection __ex_table, "a"; \ .pushsection __ex_table, "a"; \
.align 4; \
.word 9f, memcpy_common_fixup; \ .word 9f, memcpy_common_fixup; \
.popsection; \ .popsection; \
9 9
...@@ -614,5 +615,6 @@ memcpy_fixup_loop: ...@@ -614,5 +615,6 @@ memcpy_fixup_loop:
.size memcpy_common_fixup, . - memcpy_common_fixup .size memcpy_common_fixup, . - memcpy_common_fixup
.section __ex_table,"a" .section __ex_table,"a"
.align 4
.word .Lcfu, .Lcopy_from_user_fixup_zero_remainder .word .Lcfu, .Lcopy_from_user_fixup_zero_remainder
.word .Lctu, .Lcopy_to_user_fixup_done .word .Lctu, .Lcopy_to_user_fixup_done
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
".pushsection .coldtext.memcpy,\"ax\";" \ ".pushsection .coldtext.memcpy,\"ax\";" \
"2: { move r0, %2; jrp lr };" \ "2: { move r0, %2; jrp lr };" \
".section __ex_table,\"a\";" \ ".section __ex_table,\"a\";" \
".align 8;" \
".quad 1b, 2b;" \ ".quad 1b, 2b;" \
".popsection" \ ".popsection" \
: "=m" (*(p)) : "r" (v), "r" (n)); \ : "=m" (*(p)) : "r" (v), "r" (n)); \
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
".pushsection .coldtext.memcpy,\"ax\";" \ ".pushsection .coldtext.memcpy,\"ax\";" \
"2: { move r0, %2; jrp lr };" \ "2: { move r0, %2; jrp lr };" \
".section __ex_table,\"a\";" \ ".section __ex_table,\"a\";" \
".align 8;" \
".quad 1b, 2b;" \ ".quad 1b, 2b;" \
".popsection" \ ".popsection" \
: "=r" (__v) : "m" (*(p)), "r" (n)); \ : "=r" (__v) : "m" (*(p)), "r" (n)); \
......
...@@ -36,6 +36,7 @@ strnlen_user_fault: ...@@ -36,6 +36,7 @@ strnlen_user_fault:
{ move r0, zero; jrp lr } { move r0, zero; jrp lr }
ENDPROC(strnlen_user_fault) ENDPROC(strnlen_user_fault)
.section __ex_table,"a" .section __ex_table,"a"
.align 4
.word 1b, strnlen_user_fault .word 1b, strnlen_user_fault
.popsection .popsection
...@@ -59,6 +60,7 @@ strncpy_from_user_fault: ...@@ -59,6 +60,7 @@ strncpy_from_user_fault:
{ movei r0, -EFAULT; jrp lr } { movei r0, -EFAULT; jrp lr }
ENDPROC(strncpy_from_user_fault) ENDPROC(strncpy_from_user_fault)
.section __ex_table,"a" .section __ex_table,"a"
.align 4
.word 1b, strncpy_from_user_fault .word 1b, strncpy_from_user_fault
.popsection .popsection
...@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm) ...@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm)
bnzt r1, 1b bnzt r1, 1b
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 4
.word 1b, 2b .word 1b, 2b
.popsection .popsection
...@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm) ...@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm)
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
STD_ENDPROC(clear_user_asm) STD_ENDPROC(clear_user_asm)
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 4
.word 1b, 2b .word 1b, 2b
.popsection .popsection
...@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm) ...@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm)
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
STD_ENDPROC(flush_user_asm) STD_ENDPROC(flush_user_asm)
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 4
.word 1b, 2b .word 1b, 2b
.popsection .popsection
...@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm) ...@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm)
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
STD_ENDPROC(finv_user_asm) STD_ENDPROC(finv_user_asm)
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 4
.word 1b, 2b .word 1b, 2b
.popsection .popsection
...@@ -36,6 +36,7 @@ strnlen_user_fault: ...@@ -36,6 +36,7 @@ strnlen_user_fault:
{ move r0, zero; jrp lr } { move r0, zero; jrp lr }
ENDPROC(strnlen_user_fault) ENDPROC(strnlen_user_fault)
.section __ex_table,"a" .section __ex_table,"a"
.align 8
.quad 1b, strnlen_user_fault .quad 1b, strnlen_user_fault
.popsection .popsection
...@@ -59,6 +60,7 @@ strncpy_from_user_fault: ...@@ -59,6 +60,7 @@ strncpy_from_user_fault:
{ movei r0, -EFAULT; jrp lr } { movei r0, -EFAULT; jrp lr }
ENDPROC(strncpy_from_user_fault) ENDPROC(strncpy_from_user_fault)
.section __ex_table,"a" .section __ex_table,"a"
.align 8
.quad 1b, strncpy_from_user_fault .quad 1b, strncpy_from_user_fault
.popsection .popsection
...@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm) ...@@ -77,6 +79,7 @@ STD_ENTRY(clear_user_asm)
bnezt r1, 1b bnezt r1, 1b
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 8
.quad 1b, 2b .quad 1b, 2b
.popsection .popsection
...@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm) ...@@ -86,6 +89,7 @@ STD_ENTRY(clear_user_asm)
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
STD_ENDPROC(clear_user_asm) STD_ENDPROC(clear_user_asm)
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 8
.quad 1b, 2b .quad 1b, 2b
.popsection .popsection
...@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm) ...@@ -105,6 +109,7 @@ STD_ENTRY(flush_user_asm)
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
STD_ENDPROC(flush_user_asm) STD_ENDPROC(flush_user_asm)
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 8
.quad 1b, 2b .quad 1b, 2b
.popsection .popsection
...@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm) ...@@ -124,5 +129,6 @@ STD_ENTRY(finv_user_asm)
2: { move r0, r1; jrp lr } 2: { move r0, r1; jrp lr }
STD_ENDPROC(finv_user_asm) STD_ENDPROC(finv_user_asm)
.pushsection __ex_table,"a" .pushsection __ex_table,"a"
.align 8
.quad 1b, 2b .quad 1b, 2b
.popsection .popsection
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment