x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL()

Message ID 20221122071547.165296-1-namit@vmware.com
State New
Headers
Series x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL() |

Commit Message

Nadav Amit Nov. 22, 2022, 7:15 a.m. UTC
  From: Nadav Amit <namit@vmware.com>

When SYM_CODE_START_LOCAL() is used, the symbols are local but should be
saved to the object. In contrast, using ".L" label prefix causes the
symbols not to be saved in the object.

Since it is preferable to be able to map instruction pointers back to
symbols, the local symbol should be saved in the object. Therefore, when
SYM_CODE_START_LOCAL() is used, the ".L" label prefix should not be
used.

Two symbols, however, have both SYM_CODE_START_LOCAL() and ".L" prefix:
.Lbad_put_user_clac and .Lcopy_user_handle_tail. Remove the ".L" prefix
from them.

No functional change, other then emitting these symbols into the object,
is intended.

Signed-off-by: Nadav Amit <namit@vmware.com>
---
 arch/x86/lib/copy_user_64.S | 16 ++++++++--------
 arch/x86/lib/putuser.S      | 24 ++++++++++++------------
 2 files changed, 20 insertions(+), 20 deletions(-)
  

Comments

Nadav Amit Jan. 5, 2023, 8:33 p.m. UTC | #1
> On Nov 21, 2022, at 11:15 PM, Nadav Amit <nadav.amit@gmail.com> wrote:
> 
> From: Nadav Amit <namit@vmware.com>
> 
> When SYM_CODE_START_LOCAL() is used, the symbols are local but should be
> saved to the object. In contrast, using ".L" label prefix causes the
> symbols not to be saved in the object.
> 
> Since it is preferable to be able to map instruction pointers back to
> symbols, the local symbol should be saved in the object. Therefore, when
> SYM_CODE_START_LOCAL() is used, the ".L" label prefix should not be
> used.
> 
> Two symbols, however, have both SYM_CODE_START_LOCAL() and ".L" prefix:
> .Lbad_put_user_clac and .Lcopy_user_handle_tail. Remove the ".L" prefix
> from them.
> 
> No functional change, other then emitting these symbols into the object,
> is intended.
> 
> Signed-off-by: Nadav Amit <namit@vmware.com>

Ping.
  

Patch

diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index 9dec1b38a98f..92b4c17c95cd 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -83,7 +83,7 @@  SYM_FUNC_START(copy_user_generic_unrolled)
 
 30:	shll $6,%ecx
 	addl %ecx,%edx
-	jmp .Lcopy_user_handle_tail
+	jmp copy_user_handle_tail
 
 	_ASM_EXTABLE_CPY(1b, 30b)
 	_ASM_EXTABLE_CPY(2b, 30b)
@@ -139,7 +139,7 @@  SYM_FUNC_START(copy_user_generic_string)
 
 11:	leal (%rdx,%rcx,8),%ecx
 12:	movl %ecx,%edx		/* ecx is zerorest also */
-	jmp .Lcopy_user_handle_tail
+	jmp copy_user_handle_tail
 
 	_ASM_EXTABLE_CPY(1b, 11b)
 	_ASM_EXTABLE_CPY(3b, 12b)
@@ -169,7 +169,7 @@  SYM_FUNC_START(copy_user_enhanced_fast_string)
 	RET
 
 12:	movl %ecx,%edx		/* ecx is zerorest also */
-	jmp .Lcopy_user_handle_tail
+	jmp copy_user_handle_tail
 
 	_ASM_EXTABLE_CPY(1b, 12b)
 SYM_FUNC_END(copy_user_enhanced_fast_string)
@@ -190,7 +190,7 @@  EXPORT_SYMBOL(copy_user_enhanced_fast_string)
  * Output:
  * eax uncopied bytes or 0 if successful.
  */
-SYM_CODE_START_LOCAL(.Lcopy_user_handle_tail)
+SYM_CODE_START_LOCAL(copy_user_handle_tail)
 	cmp $X86_TRAP_MC,%eax
 	je 3f
 
@@ -209,9 +209,9 @@  SYM_CODE_START_LOCAL(.Lcopy_user_handle_tail)
 
 .Lcopy_user_handle_align:
 	addl %ecx,%edx			/* ecx is zerorest also */
-	jmp .Lcopy_user_handle_tail
+	jmp copy_user_handle_tail
 
-SYM_CODE_END(.Lcopy_user_handle_tail)
+SYM_CODE_END(copy_user_handle_tail)
 
 /*
  * Finish memcpy of less than 64 bytes.  #AC should already be set.
@@ -252,7 +252,7 @@  SYM_CODE_START_LOCAL(copy_user_short_string)
 40:	leal (%rdx,%rcx,8),%edx
 	jmp 60f
 50:	movl %ecx,%edx		/* ecx is zerorest also */
-60:	jmp .Lcopy_user_handle_tail
+60:	jmp copy_user_handle_tail
 
 	_ASM_EXTABLE_CPY(18b, 40b)
 	_ASM_EXTABLE_CPY(19b, 40b)
@@ -382,7 +382,7 @@  SYM_FUNC_START(__copy_user_nocache)
 	movl %ecx,%edx
 .L_fixup_handle_tail:
 	sfence
-	jmp .Lcopy_user_handle_tail
+	jmp copy_user_handle_tail
 
 	_ASM_EXTABLE_CPY(1b, .L_fixup_4x8b_copy)
 	_ASM_EXTABLE_CPY(2b, .L_fixup_4x8b_copy)
diff --git a/arch/x86/lib/putuser.S b/arch/x86/lib/putuser.S
index 32125224fcca..3c33071cec97 100644
--- a/arch/x86/lib/putuser.S
+++ b/arch/x86/lib/putuser.S
@@ -137,22 +137,22 @@  SYM_FUNC_START(__put_user_nocheck_8)
 SYM_FUNC_END(__put_user_nocheck_8)
 EXPORT_SYMBOL(__put_user_nocheck_8)
 
-SYM_CODE_START_LOCAL(.Lbad_put_user_clac)
+SYM_CODE_START_LOCAL(bad_put_user_clac)
 	ASM_CLAC
 .Lbad_put_user:
 	movl $-EFAULT,%ecx
 	RET
-SYM_CODE_END(.Lbad_put_user_clac)
+SYM_CODE_END(bad_put_user_clac)
 
-	_ASM_EXTABLE_UA(1b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(2b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(3b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(4b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(5b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(6b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(7b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(9b, .Lbad_put_user_clac)
+	_ASM_EXTABLE_UA(1b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(2b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(3b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(4b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(5b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(6b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(7b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(9b, bad_put_user_clac)
 #ifdef CONFIG_X86_32
-	_ASM_EXTABLE_UA(8b, .Lbad_put_user_clac)
-	_ASM_EXTABLE_UA(10b, .Lbad_put_user_clac)
+	_ASM_EXTABLE_UA(8b, bad_put_user_clac)
+	_ASM_EXTABLE_UA(10b, bad_put_user_clac)
 #endif