Skip to content

Implement inline static calls on PPC32 - v4

Christophe Leroy linuxppc-dev lkml oe-kbuild-all 1 version Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest4 patches 2 repliesApplied

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/4static_call_inline: Provide trampoline address when updating sitesarch/x86/kernel/static_call.c kernel/static_call_inline.c+2 -20 replies
2/4objtool/powerpc: Add support for decoding all types of uncond branchestools/objtool/arch/powerpc/decode.c+7 -12 replies
3/4powerpc: Prepare arch_static_call_transform() for supporting inline static callsarch/powerpc/kernel/static_call.c+21 -150 replies
4/4powerpc/static_call: Implement inline static callsarch/powerpc/Kconfig arch/powerpc/include/asm/static_call.h arch/powerpc/kernel/static_call.c+26 -10 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchSegher Boessenkool
1/4
2/4R-b R-b
3/4
4/4

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/4] Implement inline static calls on PPC32 - v4

This series implements inline static calls on PPC32.

First patch adds to static_call core the ability to pass the trampoline address at the same time as the site address to arch_static_call_transform() so that it can fallback on branching to the trampoline when the site is too far (Max distance for direct branch is 32 Mbytes on powerpc).

Second patch adds support for decoding all types of uncond branches.

Third patch rearranges function arch_static_call_transform() to ease implementation of inline static call in following patch.

Last patch implements inline static calls on PPC32: This is done by:
- Put a 'bl' to the destination function ('b' if tail call)
- Put a 'nop' when the destination function is NULL ('blr' if tail call)
- Put a 'li r3,0' when the destination is the RET0 function and not a tail call.

If the destination is too far (over the 32Mb limit), go via the trampoline thanks to patch 1.

Christophe Leroy (4):
static_call_inline: Provide trampoline address when updating sites objtool/powerpc: Add support for decoding all types of uncond branches
powerpc: Prepare arch_static_call_transform() for supporting inline
static calls
powerpc/static_call: Implement inline static calls

 arch/powerpc/Kconfig                   |  1 +
 arch/powerpc/include/asm/static_call.h |  2 +
 arch/powerpc/kernel/static_call.c      | 58 +++++++++++++++++++-------
 arch/x86/kernel/static_call.c          |  2 +-
 kernel/static_call_inline.c            |  2 +-
 tools/objtool/arch/powerpc/decode.c    |  8 +++-
 6 files changed, 55 insertions(+), 18 deletions(-)
Signature · 1 line
2.47.0