linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] Out-of-line static calls for powerpc64 ELF V2
@ 2022-10-10  0:29 Benjamin Gray
  2022-10-10  0:29 ` [PATCH v4 1/6] powerpc/code-patching: Implement generic text patching function Benjamin Gray
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Benjamin Gray @ 2022-10-10  0:29 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: ajd, peterz, Benjamin Gray, npiggin, ardb, jbaron, rostedt,
	jpoimboe

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/20221005053234.29312-1-bgray@linux.ibm.com/
V2: https://lore.kernel.org/all/20220926064316.765967-1-bgray@linux.ibm.com/
V1: https://lore.kernel.org/all/20220916062330.430468-1-bgray@linux.ibm.com/
RFC: https://lore.kernel.org/linuxppc-dev/20220901055823.152983-1-bgray@linux.ibm.com/

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-10-25 23:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10  0:29 [PATCH v4 0/6] Out-of-line static calls for powerpc64 ELF V2 Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 1/6] powerpc/code-patching: Implement generic text patching function Benjamin Gray
2022-10-10  4:45   ` Andrew Donnellan
2022-10-10  7:00     ` Andrew Donnellan
2022-10-10  0:29 ` [PATCH v4 2/6] powerpc/module: Handle caller-saved TOC in module linker Benjamin Gray
2022-10-25  2:10   ` Andrew Donnellan
2022-10-25 23:41     ` Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 4/6] static_call: Move static call selftest to static_call_selftest.c Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 5/6] powerpc/64: Add support for out-of-line static calls Benjamin Gray
2022-10-10  0:29 ` [PATCH v4 6/6] powerpc: Add tests " Benjamin Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).