Skip to content

unwind, arm64: add sframe unwinder for kernel

Weinan Liu linux-arm-kernel linux-toolchains live-patching lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 83 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8unwind: build kernel with sframe infoMakefile arch/Kconfig arch/arm64/Kconfig.debug +1 more+36 -03 replies
2/8arm64: entry: add unwind info for various kernel entriesarch/arm64/kernel/entry.S+10 -00 replies
3/8unwind: add sframe v2 headerkernel/sframe.h+215 -02 replies
4/8unwind: Implement generic sframe unwinder libraryinclude/linux/sframe_lookup.h kernel/Makefile kernel/sframe_lookup.c+240 -04 replies
5/8unwind: arm64: Add sframe unwinder on arm64arch/arm64/include/asm/stacktrace/common.h arch/arm64/kernel/setup.c arch/arm64/kernel/stacktrace.c+65 -01 reply
6/8unwind: arm64: add reliable stacktrace support for arm64arch/arm64/include/asm/stacktrace/common.h arch/arm64/kernel/stacktrace.c+47 -21 reply
7/8arm64: Define TIF_PATCH_PENDING for livepatcharch/arm64/include/asm/thread_info.h arch/arm64/kernel/entry-common.c+7 -12 replies
8/8arm64: Enable livepatch for ARM64arch/arm64/Kconfig+3 -03 replies

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchPrasanna Kumar T S M
1/8R-b
2/8
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] unwind, arm64: add sframe unwinder for kernel

This patchset implements a generic kernel sframe-based [1] unwinder. The main goal is to support reliable stacktraces on arm64.

On x86 orc unwinder provides reliable stacktraces. But arm64 misses the required support from objtool: it cannot generate orc unwind tables for arm64.

Currently, there's already a sframe unwinder proposed for userspace: [2]. Since the sframe unwind table algorithm is similar, these two proposal could integrate common functionality in the future.

There are some incomplete features or challenges:
- The unwinder doesn't yet work with kernel modules. The start_addr of FRE from kernel modules doesn't appear correct, preventing us from unwinding functions from kernel modules.
- Currently, only GCC supports sframe.

Ref:
[1]: https://sourceware.org/binutils/docs/sframe-spec.html
[2]: https://lore.kernel.org/lkml/[email protected]/

Madhavan T. Venkataraman (1):
arm64: Define TIF_PATCH_PENDING for livepatch

Weinan Liu (7):
unwind: build kernel with sframe info
arm64: entry: add unwind info for various kernel entries
unwind: add sframe v2 header
unwind: Implement generic sframe unwinder library
unwind: arm64: Add sframe unwinder on arm64
unwind: arm64: add reliable stacktrace support for arm64
arm64: Enable livepatch for ARM64

 Makefile                                   |   6 +
 arch/Kconfig                               |   8 +
 arch/arm64/Kconfig                         |   3 +
 arch/arm64/Kconfig.debug                   |  10 +
 arch/arm64/include/asm/stacktrace/common.h |   6 +
 arch/arm64/include/asm/thread_info.h       |   4 +-
 arch/arm64/kernel/entry-common.c           |   4 +
 arch/arm64/kernel/entry.S                  |  10 +
 arch/arm64/kernel/setup.c                  |   2 +
 arch/arm64/kernel/stacktrace.c             | 102 ++++++++++
 include/asm-generic/vmlinux.lds.h          |  12 ++
 include/linux/sframe_lookup.h              |  43 +++++
 kernel/Makefile                            |   1 +
 kernel/sframe.h                            | 215 +++++++++++++++++++++
 kernel/sframe_lookup.c                     | 196 +++++++++++++++++++
 15 files changed, 621 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/sframe_lookup.h
 create mode 100644 kernel/sframe.h
 create mode 100644 kernel/sframe_lookup.c
Signature · 1 line
2.48.1.262.g85cc9f2d1e-goog