From: Luis Chamberlain <mcgrof@kernel.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>, Miroslav Benes <mbenes@suse.cz>,
Sami Tolvanen <samitolvanen@google.com>,
Song Liu <song@kernel.org>,
live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
jikos@kernel.org, joe.lawrence@redhat.com, nathan@kernel.org,
morbo@google.com, justinstitt@google.com,
thunder.leizhen@huawei.com, kees@kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH] kallsyms, livepatch: Fix livepatch with CONFIG_LTO_CLANG
Date: Wed, 3 Jul 2024 08:30:33 -0700 [thread overview]
Message-ID: <ZoVumd-b4CaRu5nW@bombadil.infradead.org> (raw)
In-Reply-To: <20240703055641.7iugqt6it6pi2xy7@treble>
On Tue, Jul 02, 2024 at 10:56:41PM -0700, Josh Poimboeuf wrote:
> On Mon, Jul 01, 2024 at 03:13:23PM +0200, Petr Mladek wrote:
> > So, you suggest to search the symbols by a hash. Do I get it correctly?
I meant, that in the Rust world the symbols go over the allowed limit,
and so an alternative for them is to just use a hash. What I'm
suggesting is for a new kconfig option where that world is the
new one, so that they have to also do the proper userspace tooling
for it. Without that, I don't see it as properly tested or scalable.
And if we're gonna have that option for Rust for modules, then it begs
the question if this can be used by other users.
> > Well, it might bring back the original problem. I mean
> > the commit 8b8e6b5d3b013b0 ("kallsyms: strip ThinLTO hashes from
> > static functions") added cleanup_symbol_name() so that user-space
> > tool do not need to take care of the "unstable" suffix.
>
> Are symbol names really considered user ABI?? That's already broken by
> design. Even without LTO, the toolchain can mangle them for a variety
> of reasons.
>
> If a user space tool doesn't want the suffixes, surely it can figure out
> a way to deal with that on their own?
>
> > So, it seems that we have two use cases:
> >
> > 1. Some user-space tools want to ignore the extra suffix. I guess
> > that it is in the case when the suffix is added only because
> > the function was optimized.
> >
> > It can't work if there are two different functions of the same
> > name. Otherwise, the user-space tool would not know which one
> > they are tracing.
> >
> >
> > 2. There are other use-cases, including livepatching, where we
> > want to be 100% sure that we match the right symbol.
> >
> > They want to match the full names. They even need to distinguish
> > symbols with the same name.
> >
> >
> > IMHO, we need a separate API for each use-case.
>
> We should just always link with -zunique-symbols so the duplicate
> symbols no longer exist. That would solve a lot of problems.
While it might solve this other issue, it doesn't solve the rust module
long symbol name issue.
Luis
next prev parent reply other threads:[~2024-07-03 15:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 3:21 [PATCH] kallsyms, livepatch: Fix livepatch with CONFIG_LTO_CLANG Song Liu
2024-06-07 13:06 ` Miroslav Benes
2024-06-07 16:53 ` Song Liu
2024-06-28 12:23 ` Miroslav Benes
2024-06-28 17:36 ` Luis Chamberlain
2024-06-28 19:31 ` Sami Tolvanen
2024-07-01 13:13 ` Petr Mladek
2024-07-03 5:56 ` Josh Poimboeuf
2024-07-03 15:30 ` Luis Chamberlain [this message]
2024-07-04 9:02 ` Petr Mladek
2024-07-08 21:33 ` Luis Chamberlain
2024-07-09 0:07 ` Sami Tolvanen
2024-07-09 16:42 ` Song Liu
2024-07-09 17:06 ` Matthew Maurer
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=ZoVumd-b4CaRu5nW@bombadil.infradead.org \
--to=mcgrof@kernel.org \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=justinstitt@google.com \
--cc=kees@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=pmladek@suse.com \
--cc=samitolvanen@google.com \
--cc=song@kernel.org \
--cc=thunder.leizhen@huawei.com \
/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