[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <24E47178-C177-425F-A8EF-CFFAE22597D4@gmail.com>
Date: Thu, 25 May 2023 12:39:47 -0700
From: Nadav Amit <nadav.amit@...il.com>
To: Dave Hansen <dave.hansen@...el.com>,
Borislav Petkov <bp@...en8.de>,
Jiri Slaby <jirislaby@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] x86/lib: Do not use local symbols with
SYM_CODE_START_LOCAL()
> On May 25, 2023, at 12:05 PM, Dave Hansen <dave.hansen@...el.com> wrote:
>
> On 5/25/23 11:42, Nadav Amit wrote:
>> From: Nadav Amit <namit@...are.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.
>
> Nadav, could you perhaps do a bit of research on how this situation came
> to be? Was it an accident or on purpose that these symbols came to be
> .L? Then, could you CC the folks who made this change and ask them
> directly if they intended to induce the effects that you find undesirable?
Fair enough. I actually thought it is an oversight, but it now seems
intentional (although I am not sure I understand/agree with the reason).
So apparently, for one of the symbols from my v1 (which was already
removed), I see that Borislav Petkov suggested to prepend the “.L” in
order to for them not to be visible [1].
The reason that is given for not making the functions visible is that
these are "functions with very local names”.
I do not think in this tradeoff not exposing local names worth
preventing profilers (and their users) from understanding where a
sample/trace is was taken. If for instance you look at a branch
trace (e.g., using Intel PT) you want to see the symbol to which a
branch goes to.
Borislav, Jiri - do you agree?
[1] https://lore.kernel.org/all/20190906075550.23435-2-jslaby@suse.cz/
Powered by blists - more mailing lists