瀏覽代碼

sparc64: Kill .fixup section bloat.

This is an implementation of a suggestion made by Chris Torek:
--------------------
Something else I noticed in passing: the EX and EX_LD/EX_ST macros
scattered throughout the various .S files make a fair bit of .fixup
code, all of which does the same thing.  At the cost of one symbol
in copy_in_user.S, you could just have one common two-instruction
retl-and-mov-1 fixup that they all share.
--------------------

The following is with a defconfig build:

   text	   data	    bss	    dec	    hex	filename
3972767	 344024	 584449	4901240	 4ac978	vmlinux.orig
3968887	 344024	 584449	4897360	 4aba50	vmlinux

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 16 年之前
父節點
當前提交
40bdac7dbc

+ 28 - 3
arch/sparc/kernel/head_64.S

@@ -891,10 +891,35 @@ prom_tba:	.xword	0
 tlb_type:	.word	0	/* Must NOT end up in BSS */
 tlb_type:	.word	0	/* Must NOT end up in BSS */
 	.section	".fixup",#alloc,#execinstr
 	.section	".fixup",#alloc,#execinstr
 
 
-	.globl	__ret_efault, __retl_efault
-__ret_efault:
+	.globl	__ret_efault, __retl_efault, __ret_one, __retl_one
+ENTRY(__ret_efault)
 	ret
 	ret
 	 restore %g0, -EFAULT, %o0
 	 restore %g0, -EFAULT, %o0
-__retl_efault:
+ENDPROC(__ret_efault)
+
+ENTRY(__retl_efault)
 	retl
 	retl
 	 mov	-EFAULT, %o0
 	 mov	-EFAULT, %o0
+ENDPROC(__retl_efault)
+
+ENTRY(__retl_one)
+	retl
+	 mov	1, %o0
+ENDPROC(__retl_one)
+
+ENTRY(__ret_one_asi)
+	wr	%g0, ASI_AIUS, %asi
+	ret
+	 restore %g0, 1, %o0
+ENDPROC(__ret_one_asi)
+
+ENTRY(__retl_one_asi)
+	wr	%g0, ASI_AIUS, %asi
+	retl
+	 mov	1, %o0
+ENDPROC(__retl_one_asi)
+
+ENTRY(__retl_o1)
+	retl
+	 mov	%o1, %o0
+ENDPROC(__retl_o1)

+ 1 - 5
arch/sparc/lib/GENbzero.S

@@ -6,13 +6,9 @@
 
 
 #define EX_ST(x,y)		\
 #define EX_ST(x,y)		\
 98:	x,y;			\
 98:	x,y;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	%o1, %o0;	\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_o1;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/GENcopy_from_user.S

@@ -5,13 +5,9 @@
 
 
 #define EX_LD(x)		\
 #define EX_LD(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/GENcopy_to_user.S

@@ -5,13 +5,9 @@
 
 
 #define EX_ST(x)		\
 #define EX_ST(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 6
arch/sparc/lib/NG2copy_from_user.S

@@ -5,14 +5,9 @@
 
 
 #define EX_LD(x)		\
 #define EX_LD(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	wr	%g0, ASI_AIUS, %asi;\
-	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one_asi;\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 6
arch/sparc/lib/NG2copy_to_user.S

@@ -5,14 +5,9 @@
 
 
 #define EX_ST(x)		\
 #define EX_ST(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	wr	%g0, ASI_AIUS, %asi;\
-	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one_asi;\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/NGbzero.S

@@ -6,13 +6,9 @@
 
 
 #define EX_ST(x,y)		\
 #define EX_ST(x,y)		\
 98:	x,y;			\
 98:	x,y;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	%o1, %o0;	\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_o1;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 6
arch/sparc/lib/NGcopy_from_user.S

@@ -5,14 +5,9 @@
 
 
 #define EX_LD(x)		\
 #define EX_LD(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	wr	%g0, ASI_AIUS, %asi;\
-	ret;			\
-	 restore %g0, 1, %o0;	\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __ret_one_asi;\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 6
arch/sparc/lib/NGcopy_to_user.S

@@ -5,14 +5,9 @@
 
 
 #define EX_ST(x)		\
 #define EX_ST(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	wr	%g0, ASI_AIUS, %asi;\
-	ret;			\
-	 restore %g0, 1, %o0;	\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __ret_one_asi;\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/U1copy_from_user.S

@@ -5,13 +5,9 @@
 
 
 #define EX_LD(x)		\
 #define EX_LD(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/U1copy_to_user.S

@@ -5,13 +5,9 @@
 
 
 #define EX_ST(x)		\
 #define EX_ST(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/U3copy_from_user.S

@@ -5,13 +5,9 @@
 
 
 #define EX_LD(x)		\
 #define EX_LD(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/U3copy_to_user.S

@@ -5,13 +5,9 @@
 
 
 #define EX_ST(x)		\
 #define EX_ST(x)		\
 98:	x;			\
 98:	x;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/bzero.S

@@ -88,13 +88,9 @@ __bzero_done:
 
 
 #define EX_ST(x,y)		\
 #define EX_ST(x,y)		\
 98:	x,y;			\
 98:	x,y;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov	%o1, %o0;	\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_o1;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;
 
 

+ 1 - 5
arch/sparc/lib/copy_in_user.S

@@ -9,13 +9,9 @@
 
 
 #define EX(x,y)			\
 #define EX(x,y)			\
 98:	x,y;			\
 98:	x,y;			\
-	.section .fixup;	\
-	.align 4;		\
-99:	retl;			\
-	 mov 1, %o0;		\
 	.section __ex_table,"a";\
 	.section __ex_table,"a";\
 	.align 4;		\
 	.align 4;		\
-	.word 98b, 99b;		\
+	.word 98b, __retl_one;	\
 	.text;			\
 	.text;			\
 	.align 4;
 	.align 4;