lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/8] perf libunwind: arm64 pointer authentication
Date
Make use of new changes in libunwind to decode a pointer which has a
pointer authentication code (PAC) in it.

Before this patch, perf is not able to produce stack traces where the
instruction addresses had PACs in them.

This commit has a dependency on a libunwind pull request:

https://github.com/libunwind/libunwind/pull/360

Signed-off-by: Andrew Kilroy <andrew.kilroy@arm.com>
---
tools/perf/util/unwind-libunwind-local.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 6e5b8cce47bf..6983a3e76a71 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -652,6 +652,15 @@ static void display_error(int err)
}
}

+#ifndef NO_LIBUNWIND_ARM64_PTRAUTH
+static unw_word_t get_insn_mask(unw_addr_space_t addr_space __maybe_unused, void *unwind_info_ptr)
+{
+ struct unwind_info *ui = unwind_info_ptr;
+ unw_word_t mask = ui->sample->ptrauth.insn_mask;
+ return mask;
+}
+#endif
+
static unw_accessors_t accessors = {
.find_proc_info = find_proc_info,
.put_unwind_info = put_unwind_info,
@@ -661,6 +670,9 @@ static unw_accessors_t accessors = {
.access_fpreg = access_fpreg,
.resume = resume,
.get_proc_name = get_proc_name,
+#ifndef NO_LIBUNWIND_ARM64_PTRAUTH
+ .ptrauth_insn_mask = get_insn_mask,
+#endif
};

static int _unwind__prepare_access(struct maps *maps)
--
2.17.1
\
 
 \ /
  Last update: 2022-07-04 16:57    [W:0.122 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site