On Fri, 10 Jul 2020 15:38:37 +0200 Peter Zijlstra <[email protected]> wrote:
> From: Josh Poimboeuf <[email protected]> > > Static calls are a replacement for global function pointers. They use > code patching to allow direct calls to be used instead of indirect > calls. They give the flexibility of function pointers, but with > improved performance. This is especially important for cases where > retpolines would otherwise be used, as retpolines can significantly > impact performance. > > The concept and code are an extension of previous work done by Ard > Biesheuvel and Steven Rostedt: > > https://lkml.kernel.org/r/[email protected] > https://lkml.kernel.org/r/[email protected] > > There are two implementations, depending on arch support: > > 1) out-of-line: patched trampolines (CONFIG_HAVE_STATIC_CALL) > 2) basic function pointers > > For more details, see the comments in include/linux/static_call.h. > > [peterz: simplified interface] > Signed-off-by: Josh Poimboeuf <[email protected]> > Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]> -- Steve

