Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Clark <james.clark@linaro.org>
To: Jakub Brnak <jbrnak@redhat.com>,
	James Clark <james.clark@arm.com>, Leo Yan <leo.yan@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-perf-users@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, broonie@kernel.org,
	acme@kernel.org, Andrew Kilroy <andrew.kilroy@arm.com>,
	Vince Weaver <vincent.weaver@maine.edu>,
	Mark Rutland <mark.rutland@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Will Deacon <will@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	kristina.martsenko@arm.com
Subject: Re: [PATCH v2 1/1] perf arm64: Send pointer auth masks to ring buffer
Date: Tue, 3 Mar 2026 10:38:23 +0000	[thread overview]
Message-ID: <197f3d1e-5d1e-4b2d-a12b-782287eecc43@linaro.org> (raw)
In-Reply-To: <aaW7s-ISz1QGpmqB@jbrnak-thinkpadx1carbongen9.tpbc.csb>



On 02/03/2026 4:33 pm, Jakub Brnak wrote:
> On Mon, Oct 31, 2022 at 01:48:56PM +0000, James Clark wrote:
>>
>>
>> On 27/10/2022 18:20, Peter Zijlstra wrote:
>>> On Tue, Oct 25, 2022 at 04:28:12PM +0100, James Clark wrote:
>>>
>>>>> Why do we want the same mask repeated over and over with each sample;
>>>>> should this not be part of the address space (side-band) data?
>>>>
>>>> You are probably right that it could be done that way. The reason that
>>>> we did it this way was to be consistent with ptrace feature [1] where it
>>>> is delivered to userspace on a per-process basis. And there is also a
>>>> prctl for the enabled key types [2] which can be changed dynamically.
>>>> Particularly for the last reason is why it was done per sample.
>>>>
>>>> Having said that, the enabled keys field is not used by perf, only the
>>>> mask is used, so I can drop the per sample data until enabled keys is
>>>> needed, which may be never.
>>>>
>>>> I'm going to assume that perf shouldn't use ptrace because of
>>>> permissions and conflicts with debuggers, so I could put the mask
>>>> somewhere like PERF_RECORD_FORK instead of per sample.
>>>
>>> Yeah, or create an new RECORD type which you can also send around at
>>> prctl() time.
>>>
>>> The only thing that's needed on top of that is exposing the mask
>>> somewhere in /proc for existing tasks; which is what perf also uses to
>>> syntesize RECORD_MMAP events on startup etc..
>>>
>>
>> Hmm ok, in that case I can just add the /proc interface for now because
>> the mask won't change and we can add the new record type at the point
>> it's needed in the future.
>>
>> Thanks for the feedback.
> 
> Hi all,
> 
> Does anyone know how this issue was eventually resolved?
> Specifically, is the mask for the pointer authentication bits
> currently exposed and stored somewhere in perf.data so it can be
> used when running perf report?
> 
> Thanks,
> Jakub
> 
> 

Hi Jakub,

No we never finished this, you're actually the first person to mention 
it. Can you give a bit more detail about your use case? Maybe we can dig 
out the old branches and work on it again.

For a summary of the current status, frame pointer unwinds in the kernel 
are working with pointer auth because the kernel strips them.

We patched libunwind for support on commit f67ef2867bc5 ("Unwind with 
pointer authentication on arm64"). And libdw on commit 0af6c7289c22 
(libdwfl, aarch64: Demangle return addresses using a PAC mask). These 
two were to support dwarf unwinding, but the kernel changes to expose 
the mask and Perf changes to pass it to the unwinders were never finished.

Thanks
James



  reply	other threads:[~2026-03-03 10:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 10:19 [PATCH v2 0/1] Perf stack unwinding with pointer authentication James Clark
2022-10-20 10:19 ` [PATCH v2 1/1] perf arm64: Send pointer auth masks to ring buffer James Clark
2022-10-20 16:49   ` Peter Zijlstra
2022-10-20 17:00     ` Peter Zijlstra
2022-10-25 15:28     ` James Clark
2022-10-27 14:11       ` James Clark
2022-10-27 17:25         ` Peter Zijlstra
2022-10-27 17:20       ` Peter Zijlstra
2022-10-31 13:48         ` James Clark
2026-03-02 16:33           ` Jakub Brnak
2026-03-03 10:38             ` James Clark [this message]
2026-03-03 15:26               ` Jakub Brnak
2026-03-04  9:10                 ` James Clark

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=197f3d1e-5d1e-4b2d-a12b-782287eecc43@linaro.org \
    --to=james.clark@linaro.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andrew.kilroy@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.clark@arm.com \
    --cc=jbrnak@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=kristina.martsenko@arm.com \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vincent.weaver@maine.edu \
    --cc=will@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