Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function"

From: Peter Zijlstra
Date: Sat Oct 06 2018 - 08:12:49 EST


On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote:
> +#define arch_dynfunc_trampoline(name, def) \
> + asm volatile ( \
> + ".globl dynfunc_" #name "; \n\t" \
> + "dynfunc_" #name ": \n\t" \
> + "jmp " #def " \n\t" \
> + ".balign 8 \n \t" \
> + : : : "memory" )

Bah, what is it with you people and trampolines. Why can't we, just like
jump_label, patch the call directly?

The whole call+jmp thing is silly, don't do that. It just wrecks I$ and
is slower for no real reason afaict.

Steve, also see:

https://lkml.kernel.org/r/20181005081333.15018-1-ard.biesheuvel@xxxxxxxxxx