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 v2] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL()
Date: Thu, 25 May 2023 11:42:44 -0700 [thread overview]
Message-ID: <20230525184244.2311-1-namit@vmware.com> (raw)
From: Nadav Amit <namit@vmware.com>
When SYM_CODE_START_LOCAL() is used, the symbols are local but need to
be preserved in the object. However, using the ".L" label prefix does
not retain the symbol in the object.
It is beneficial to be able to map instruction pointers back to symbols,
for instance for profiling. Otherwise, there are code addresses that do
not map back to any symbol. Consequently, the ".L" label prefix should
not be used when SYM_CODE_START_LOCAL() is used.
Few symbols, such as .Lbad_put_user_clac and currently have both the
SYM_CODE_START_LOCAL() invocation and the ".L" prefix. This commit
removes the ".L" prefix from these symbols.
No functional change, other then emitting these symbols into the object,
is intended.
Signed-off-by: Nadav Amit <namit@vmware.com>
---
v1 -> v2:
* Rebase on 6.4 (the affected symbols have changed)
---
arch/x86/lib/getuser.S | 32 ++++++++++++++++----------------
arch/x86/lib/putuser.S | 24 ++++++++++++------------
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S
index b64a2bd1a1ef..d98a80e0cdaf 100644
--- a/arch/x86/lib/getuser.S
+++ b/arch/x86/lib/getuser.S
@@ -143,43 +143,43 @@ SYM_FUNC_END(__get_user_nocheck_8)
EXPORT_SYMBOL(__get_user_nocheck_8)
-SYM_CODE_START_LOCAL(.Lbad_get_user_clac)
+SYM_CODE_START_LOCAL(bad_get_user_clac)
ASM_CLAC
.Lbad_get_user:
xor %edx,%edx
mov $(-EFAULT),%_ASM_AX
RET
-SYM_CODE_END(.Lbad_get_user_clac)
+SYM_CODE_END(bad_get_user_clac)
#ifdef CONFIG_X86_32
-SYM_CODE_START_LOCAL(.Lbad_get_user_8_clac)
+SYM_CODE_START_LOCAL(bad_get_user_8_clac)
ASM_CLAC
bad_get_user_8:
xor %edx,%edx
xor %ecx,%ecx
mov $(-EFAULT),%_ASM_AX
RET
-SYM_CODE_END(.Lbad_get_user_8_clac)
+SYM_CODE_END(bad_get_user_8_clac)
#endif
/* get_user */
- _ASM_EXTABLE(1b, .Lbad_get_user_clac)
- _ASM_EXTABLE(2b, .Lbad_get_user_clac)
- _ASM_EXTABLE(3b, .Lbad_get_user_clac)
+ _ASM_EXTABLE(1b, bad_get_user_clac)
+ _ASM_EXTABLE(2b, bad_get_user_clac)
+ _ASM_EXTABLE(3b, bad_get_user_clac)
#ifdef CONFIG_X86_64
- _ASM_EXTABLE(4b, .Lbad_get_user_clac)
+ _ASM_EXTABLE(4b, bad_get_user_clac)
#else
- _ASM_EXTABLE(4b, .Lbad_get_user_8_clac)
- _ASM_EXTABLE(5b, .Lbad_get_user_8_clac)
+ _ASM_EXTABLE(4b, bad_get_user_8_clac)
+ _ASM_EXTABLE(5b, bad_get_user_8_clac)
#endif
/* __get_user */
- _ASM_EXTABLE(6b, .Lbad_get_user_clac)
- _ASM_EXTABLE(7b, .Lbad_get_user_clac)
- _ASM_EXTABLE(8b, .Lbad_get_user_clac)
+ _ASM_EXTABLE(6b, bad_get_user_clac)
+ _ASM_EXTABLE(7b, bad_get_user_clac)
+ _ASM_EXTABLE(8b, bad_get_user_clac)
#ifdef CONFIG_X86_64
- _ASM_EXTABLE(9b, .Lbad_get_user_clac)
+ _ASM_EXTABLE(9b, bad_get_user_clac)
#else
- _ASM_EXTABLE(9b, .Lbad_get_user_8_clac)
- _ASM_EXTABLE(10b, .Lbad_get_user_8_clac)
+ _ASM_EXTABLE(9b, bad_get_user_8_clac)
+ _ASM_EXTABLE(10b, bad_get_user_8_clac)
#endif
diff --git a/arch/x86/lib/putuser.S b/arch/x86/lib/putuser.S
index 3062d09a776d..f0c80e07229d 100644
--- a/arch/x86/lib/putuser.S
+++ b/arch/x86/lib/putuser.S
@@ -131,22 +131,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(1b, .Lbad_put_user_clac)
- _ASM_EXTABLE(2b, .Lbad_put_user_clac)
- _ASM_EXTABLE(3b, .Lbad_put_user_clac)
- _ASM_EXTABLE(4b, .Lbad_put_user_clac)
- _ASM_EXTABLE(5b, .Lbad_put_user_clac)
- _ASM_EXTABLE(6b, .Lbad_put_user_clac)
- _ASM_EXTABLE(7b, .Lbad_put_user_clac)
- _ASM_EXTABLE(9b, .Lbad_put_user_clac)
+ _ASM_EXTABLE(1b, bad_put_user_clac)
+ _ASM_EXTABLE(2b, bad_put_user_clac)
+ _ASM_EXTABLE(3b, bad_put_user_clac)
+ _ASM_EXTABLE(4b, bad_put_user_clac)
+ _ASM_EXTABLE(5b, bad_put_user_clac)
+ _ASM_EXTABLE(6b, bad_put_user_clac)
+ _ASM_EXTABLE(7b, bad_put_user_clac)
+ _ASM_EXTABLE(9b, bad_put_user_clac)
#ifdef CONFIG_X86_32
- _ASM_EXTABLE(8b, .Lbad_put_user_clac)
- _ASM_EXTABLE(10b, .Lbad_put_user_clac)
+ _ASM_EXTABLE(8b, bad_put_user_clac)
+ _ASM_EXTABLE(10b, bad_put_user_clac)
#endif
--
2.25.1
next reply other threads:[~2023-05-25 18:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 18:42 Nadav Amit [this message]
2023-05-25 19:05 ` [PATCH v2] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL() Dave Hansen
2023-05-25 19:39 ` Nadav Amit
2023-05-26 6:24 ` Jiri Slaby
2023-05-26 15:53 ` Borislav Petkov
2023-05-26 17:29 ` Nadav Amit
2023-05-26 20:45 ` Borislav Petkov
2023-05-26 21:10 ` Nadav Amit
2023-05-26 21:17 ` Dave Hansen
2023-05-26 21:55 ` Nadav Amit
2023-05-27 7:23 ` Borislav Petkov
2023-05-27 9:17 ` Nadav Amit
2023-05-27 12:29 ` Borislav Petkov
2023-05-27 13:09 ` Nadav Amit
2023-06-02 0:53 ` Nadav Amit
2023-06-02 8:59 ` [tip: x86/misc] x86/lib: Make get/put_user() exception handling a visible symbol tip-bot2 for 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=20230525184244.2311-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