Skip to content

Out-of-line static calls for powerpc64 ELF V2

Benjamin Gray linuxppc-dev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest6 patches 4 repliesIn review
  2. v36 patches 18 repliesSuperseded
  3. v26 patches 20 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches11 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6powerpc/code-patching: Implement generic text patching functionarch/powerpc/include/asm/code-patching.h arch/powerpc/lib/code-patching.c+85 -172 replies
2/6powerpc/module: Handle caller-saved TOC in module linkerarch/powerpc/kernel/module_64.c+13 -12 replies
3/6powerpc/module: Optimise nearby branches in ELF V2 ABI stubarch/powerpc/kernel/module_64.c+12 -00 replies
4/6static_call: Move static call selftest to static_call_selftest.ckernel/Makefile kernel/static_call_inline.c kernel/static_call_selftest.c+42 -430 replies
5/6powerpc/64: Add support for out-of-line static callsarch/powerpc/Kconfig arch/powerpc/include/asm/code-patching.h arch/powerpc/include/asm/static_call.h +2 more+216 -120 replies
6/6powerpc: Add tests for out-of-line static callsarch/powerpc/Kconfig arch/powerpc/kernel/Makefile arch/powerpc/kernel/static_call.c +2 more+385 -00 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchChristophe LeroyAndrew Donnellan
1/6R-b
2/6R-b
3/6R-b R-b
4/6R-b R-b
5/6R-b
6/6

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

Read the v4 thread

Cover letter [PATCH v4 0/6] Out-of-line static calls for powerpc64 ELF V2

Implementation of out-of-line static calls for PowerPC 64-bit ELF V2 ABI. Static calls patch an indirect branch into a direct branch at runtime. Out-of-line specifically has a caller directly call a trampoline, and the trampoline gets patched to directly call the target.

Previous versions here:
V3: https://lore.kernel.org/all/[email protected]/
V2: https://lore.kernel.org/all/[email protected]/
V1: https://lore.kernel.org/all/[email protected]/
RFC: https://lore.kernel.org/linuxppc-dev/[email protected]/

Still rebased on top of
https://lore.kernel.org/all/0df84a2eea551c1d000c34c36d0c1d23cbe26a97.1664289176.git.christophe.leroy@csgroup.eu/

Changed for V4:

[1/6]
* IS_ENABLED(CONFIG_PPC64) added to patch size condition for better compiler optimisation

[2/6]
* Reworded message
* Refactored need r2 save expression. Parens are intentional, C operator precedence can be difficult to remember, especially when three different kinds are used in a single expression.

Benjamin Gray (6):
powerpc/code-patching: Implement generic text patching function powerpc/module: Handle caller-saved TOC in module linker powerpc/module: Optimise nearby branches in ELF V2 ABI stub
static_call: Move static call selftest to static_call_selftest.c powerpc/64: Add support for out-of-line static calls
powerpc: Add tests for out-of-line static calls

 arch/powerpc/Kconfig                     |  26 ++-
 arch/powerpc/include/asm/code-patching.h |  30 +++
 arch/powerpc/include/asm/static_call.h   |  80 ++++++-
 arch/powerpc/kernel/Makefile             |   4 +-
 arch/powerpc/kernel/module_64.c          |  26 ++-
 arch/powerpc/kernel/static_call.c        | 183 +++++++++++++++-
 arch/powerpc/kernel/static_call_test.c   | 263 +++++++++++++++++++++++
 arch/powerpc/kernel/static_call_test.h   |  56 +++++
 arch/powerpc/lib/code-patching.c         |  73 +++++--
 kernel/Makefile                          |   1 +
 kernel/static_call_inline.c              |  43 ----
 kernel/static_call_selftest.c            |  41 ++++
 12 files changed, 753 insertions(+), 73 deletions(-)
 create mode 100644 arch/powerpc/kernel/static_call_test.c
 create mode 100644 arch/powerpc/kernel/static_call_test.h
 create mode 100644 kernel/static_call_selftest.c

base-commit: 86de6882270620777fe9cc16ece97e9ee407122c --
2.37.3