linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Implement inline static calls on PPC32 - v4
@ 2024-12-03 19:44 Christophe Leroy
  2024-12-03 19:44 ` [PATCH v4 1/4] static_call_inline: Provide trampoline address when updating sites Christophe Leroy
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Christophe Leroy @ 2024-12-03 19:44 UTC (permalink / raw)
  To: Shrikanth Hegde, Peter Zijlstra, Josh Poimboeuf, Jason Baron,
	Steven Rostedt, Ard Biesheuvel, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	Michael Ellerman, Nicholas Piggin, Naveen N Rao,
	Madhavan Srinivasan
  Cc: Christophe Leroy, linux-kernel, linuxppc-dev

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(-)

-- 
2.47.0



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

end of thread, other threads:[~2025-03-02  4:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 19:44 [PATCH v4 0/4] Implement inline static calls on PPC32 - v4 Christophe Leroy
2024-12-03 19:44 ` [PATCH v4 1/4] static_call_inline: Provide trampoline address when updating sites Christophe Leroy
2024-12-03 19:44 ` [PATCH v4 2/4] objtool/powerpc: Add support for decoding all types of uncond branches Christophe Leroy
2024-12-04 14:09   ` Segher Boessenkool
2025-02-25  8:05   ` [PATCH v5 " Christophe Leroy
2024-12-03 19:44 ` [PATCH v4 3/4] powerpc: Prepare arch_static_call_transform() for supporting inline static calls Christophe Leroy
2024-12-03 19:44 ` [PATCH v4 4/4] powerpc/static_call: Implement " Christophe Leroy
2024-12-04 20:09   ` kernel test robot
2025-03-02  4:40 ` [PATCH v4 0/4] Implement inline static calls on PPC32 - v4 Madhavan Srinivasan

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).