Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4d9eab4 authored by Chris Metcalf's avatar Chris Metcalf
Browse files

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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:"						\
+6 −0
Original line number Original line Diff line number Diff line
@@ -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);
		     "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);
			     "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)
		     ".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)
			     ".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"				\
+1 −0
Original line number Original line Diff line number Diff line
@@ -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
+2 −0
Original line number Original line Diff line number Diff line
@@ -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:
	.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
+2 −0
Original line number Original line Diff line number Diff line
@@ -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 @@
		    ".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));	\
Loading