mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL()
@ 2022-11-22  7:15 Nadav Amit
  2023-01-05 20:33 ` Nadav Amit
  0 siblings, 1 reply; 2+ messages in thread
From: Nadav Amit @ 2022-11-22  7:15 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, x86, linux-kernel, Nadav Amit

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(-)

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
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL()
  2022-11-22  7:15 [PATCH] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL() Nadav Amit
@ 2023-01-05 20:33 ` Nadav Amit
  0 siblings, 0 replies; 2+ messages in thread
From: Nadav Amit @ 2023-01-05 20:33 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, x86, linux-kernel



> 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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-05 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22  7:15 [PATCH] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL() Nadav Amit
2023-01-05 20:33 ` Nadav Amit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®