perf arm64: Send pointer auth masks to ring buffer
Perf report cannot produce callgraphs using dwarf on arm64 where pointer authentication is enabled. This is because libunwind and libdw cannot unmangle instruction pointers that have a pointer authentication code (PAC) embedded in them. libunwind and libdw need to be given an instruction mask which they can use to arrive at the correct return address that does not contain the PAC. The bits in the return address that contain the PAC can differ by process, so this patch adds a new sample field PERF_SAMPLE_ARCH_1 to allow the kernel to send the masks up to userspace perf. This field can be used in a architecture specific fashion, but on arm64, it contains the ptrauth mask information. The event will currently fail to open on architectures other than arm64 if PERF_SAMPLE_ARCH_1 is set. It will also fail to open on arm64 if CONFIG_ARM64_PTR_AUTH isn't set, as the data would always be zeros. Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by:Andrew Kilroy <andrew.kilroy@arm.com> Signed-off-by:
James Clark <james.clark@arm.com>
Loading
Please register or sign in to comment