From: Nadav Amit <nadav.amit@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Nadav Amit <namit@vmware.com>
Subject: [PATCH] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL()
Date: Mon, 21 Nov 2022 23:15:47 -0800 [thread overview]
Message-ID: <20221122071547.165296-1-namit@vmware.com> (raw)
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
next reply other threads:[~2022-11-22 7:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 7:15 Nadav Amit [this message]
2023-01-05 20:33 ` Nadav Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221122071547.165296-1-namit@vmware.com \
--to=nadav.amit@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namit@vmware.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®