Skip to content

arm64: livepatch: Enable livepatch without sframe

Song Liu linux-arm-kernel linux-toolchains live-patching lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 16 repliesIn review
  2. v22 patches 2 repliesSuperseded
  3. v12 patches 13 repliesSuperseded

Changes in v3 from the cover letter

1. Remove a redundant check for -ENOENT. (Josh Poimboeuf)
2. Add Tested-by and Acked-by on v1. (I forgot to add them in v2.)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm64: Implement arch_stack_walk_reliablearch/arm64/Kconfig arch/arm64/kernel/stacktrace.c+51 -179 replies
2/2arm64: Implement HAVE_LIVEPATCHarch/arm64/Kconfig arch/arm64/include/asm/thread_info.h arch/arm64/kernel/entry-common.c+10 -11 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMiroslav BenesBreno LeitaoJosh PoimboeufAndrea della PortaPetr MladekSong Liu
SeriesR-b
1/2R-b R-b T-b Reviewed-and-tested-by
2/2A-b T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/2] arm64: livepatch: Enable livepatch without sframe

There are recent efforts to enable livepatch for arm64, with sframe [1] or without sframe [2]. This set tries to enable livepatch without sframe. Some of the code, however, are from [1].

Although the sframe implementation is more promising in longer term, it suffers from the following issues:

1. sframe is not yet supported in llvm;
2. There is still bug in binutil [3], so that we cannot yet use sframe

     with gcc;

3. sframe unwinder hasn't been fully verified in the kernel.

On the other hand, arm64 processors have become more and more important in the data center world. Therefore, it is getting critical to support livepatching of arm64 kernels.

With recent change in arm64 unwinder [4], it is possible to reliably livepatch arm64 kernels without sframe. This is because we do not need arch_stack_walk_reliable() to get reliable stack trace in all scenarios. Instead, we only need arch_stack_walk_reliable() to detect when the stack trace is not reliable, then the livepatch logic can retry the patch transition at a later time.

Given the increasing need of livepatching, and relatively long time before sframe is fully ready (for both gcc and clang), we would like to enable livepatch without sframe.

Thanks!

[1] https://lore.kernel.org/live-patching/[email protected]/
[2] https://lore.kernel.org/live-patching/[email protected]/
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=32589
[4] https://lore.kernel.org/linux-arm-kernel/[email protected]/

Changes v2 => v3:
1. Remove a redundant check for -ENOENT. (Josh Poimboeuf)
2. Add Tested-by and Acked-by on v1. (I forgot to add them in v2.)

v2: https://lore.kernel.org/live-patching/[email protected]/

Changes v1 => v2:

1. Rework arch_stack_walk_reliable().

v1: https://lore.kernel.org/live-patching/[email protected]/

Song Liu (2):
arm64: Implement arch_stack_walk_reliable
arm64: Implement HAVE_LIVEPATCH

 arch/arm64/Kconfig                   |  3 ++
 arch/arm64/include/asm/thread_info.h |  4 +-
 arch/arm64/kernel/entry-common.c     |  4 ++
 arch/arm64/kernel/stacktrace.c       | 66 +++++++++++++++++++++-------
 4 files changed, 60 insertions(+), 17 deletions(-)

--
2.47.1