From: Peter Zijlstra <peterz@infradead.org>
To: Carlos Llamas <cmllamas@google.com>
Cc: linux-arm-kernel@lists.infradead.org,
Sami Tolvanen <samitolvanen@google.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>,
Mark Rutland <mark.rutland@arm.com>, Kees Cook <kees@kernel.org>,
Quentin Perret <qperret@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Will McVicker <willmcvicker@google.com>,
Sean Christopherson <seanjc@google.com>,
kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7] arm64: implement support for static call trampolines
Date: Fri, 13 Mar 2026 09:52:32 +0100 [thread overview]
Message-ID: <20260313085232.GJ606826@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260313061852.4025964-1-cmllamas@google.com>
On Fri, Mar 13, 2026 at 06:18:52AM +0000, Carlos Llamas wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> Implement arm64 support for the 'unoptimized' static call variety, which
> routes all calls through a single trampoline that is patched to perform a
> tail call to the selected function.
>
> Since static call targets may be located in modules loaded out of direct
> branching range, we need to use a ADRP/ADD pair to load the branch target
> into R16 and use a branch-to-register (BR) instruction to perform an
> indirect call. Unlike on x86, there is no pressing need on arm64 to avoid
> indirect calls at all cost, but hiding it from the compiler as is done
> here does have some benefits:
> - the literal is located in .rodata, which gives us the same robustness
> advantage that code patching does;
> - no performance hit on CFI enabled Clang builds that decorate compiler
> emitted indirect calls with branch target validity checks.
>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Carlos Llamas <cmllamas@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
next prev parent reply other threads:[~2026-03-13 8:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 6:18 [PATCH v7] arm64: implement support for static call trampolines Carlos Llamas
2026-03-13 8:52 ` Peter Zijlstra [this message]
2026-03-13 16:48 ` Sami Tolvanen
2026-03-13 17:15 ` Carlos Llamas
2026-03-17 10:59 ` Ard Biesheuvel
2026-03-17 11:24 ` Peter Zijlstra
2026-03-17 11:31 ` Ard Biesheuvel
2026-03-17 11:34 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260313085232.GJ606826@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=cmllamas@google.com \
--cc=jpoimboe@kernel.org \
--cc=kees@kernel.org \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=qperret@google.com \
--cc=rostedt@goodmis.org \
--cc=samitolvanen@google.com \
--cc=seanjc@google.com \
--cc=will@kernel.org \
--cc=willmcvicker@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox