Re: [PATCH v4 09/18] x86/static_call: Add out-of-line static call implementation

From: Peter Zijlstra
Date: Wed May 06 2020 - 12:16:34 EST


On Fri, May 01, 2020 at 10:28:58PM +0200, Peter Zijlstra wrote:

> +#define ARCH_DEFINE_STATIC_CALL_TRAMP(name, func) \
> + asm(".pushsection .text, \"ax\" \n" \
> + ".align 4 \n" \
> + ".globl " STATIC_CALL_TRAMP_STR(name) " \n" \
> + STATIC_CALL_TRAMP_STR(name) ": \n" \
> + " jmp.d32 " #func " \n" \

I remembered Nick asked this to be .byte 0xe9; .long #func - (.+4); last
time, now done.

> + ".type " STATIC_CALL_TRAMP_STR(name) ", @function \n" \
> + ".size " STATIC_CALL_TRAMP_STR(name) ", . - " STATIC_CALL_TRAMP_STR(name) " \n" \
> + ".popsection \n")