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

From: Steven Rostedt
Date: Fri Oct 05 2018 - 22:02:26 EST


On Fri, 05 Oct 2018 21:51:11 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> 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" )
> +

Note, the assembler can easily put in a two byte jump here. The .balign
was suppose to also have some padding (nop) incase that happens. It's
fine, because we can just replace it with a 5 byte jump, as long as we
have 3 bytes afterward if it is a two byte jump.

-- Steve