[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200506181602.GZ3762@hirez.programming.kicks-ass.net>
Date: Wed, 6 May 2020 20:16:02 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, rostedt@...dmis.org,
mhiramat@...nel.org, bristot@...hat.com, jbaron@...mai.com,
torvalds@...ux-foundation.org, tglx@...utronix.de,
mingo@...nel.org, namit@...are.com, hpa@...or.com, luto@...nel.org,
ard.biesheuvel@...aro.org, pbonzini@...hat.com,
mathieu.desnoyers@...icios.com
Subject: Re: [PATCH v4 14/18] static_call: Add static_cond_call()
On Wed, May 06, 2020 at 01:09:24PM -0500, Josh Poimboeuf wrote:
> #define __ARCH_DEFINE_STATIC_CALL_TRAMP(name, insns) \
> asm(".pushsection .static_call.text, \"ax\" \n" \
> ".align 4 \n" \
> ".globl " STATIC_CALL_TRAMP_STR(name) " \n" \
> STATIC_CALL_TRAMP_STR(name) ": \n" \
> insns " \n" \
> ".type " STATIC_CALL_TRAMP_STR(name) ", @function \n" \
> ".size " STATIC_CALL_TRAMP_STR(name) ", . - " STATIC_CALL_TRAMP_STR(name) " \n" \
> ".popsection \n")
>
> #define ARCH_DEFINE_STATIC_CALL_TRAMP(name, func) \
> __ARCH_DEFINE_STATIC_CALL_TRAMP(name, "jmp.d32 " # func)
Note that this one is now:
.byte 0xe9; .long #func - (. + 4);
due to clang not actually understanding jmp.d32 :-(
> #define ARCH_DEFINE_STATIC_CALL_RETTRAMP(name, func) \
> __ARCH_DEFINE_STATIC_CALL_TRAMP(name, "ret; nop; nop; nop; nop")
>
> I like it. Makes it easy to see the differences between the tramps.
OK, ok.. changed :-)
Powered by blists - more mailing lists