From: Peter Zijlstra <peterz@infradead.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: mark.rutland@arm.com, catalin.marinas@arm.com,
broonie@kernel.org, will@kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: implement support for static call trampolines
Date: Mon, 19 Oct 2020 19:05:50 +0200 [thread overview]
Message-ID: <20201019170550.GR2611@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201019141247.25122-1-ardb@kernel.org>
On Mon, Oct 19, 2020 at 04:12:47PM +0200, Ard Biesheuvel wrote:
> 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 be able to fall back to issuing
> a ADRP/ADD pair to load the branch target into R16 and use a BR
> instruction. As this involves patching more than a single B or NOP
> instruction (for which the architecture makes special provisions
> in terms of the synchronization needed), we should take care to
> only use aarch64_insn_patch_text_nosync() if the subsequent
> instruction is still a 'RET' (which guarantees that the one being
> patched is a B or a NOP)
Aside of lacking objtool support (which is being worked on), is there
anything else in the way of also doing inline patching for ARM64?
That is; if the function is not reachable by the immediate you can
always leave (re-instate) the call to the trampoline after patching
that.
Anyway, nice to see ARM64 support, thanks!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-10-19 17:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 14:12 [PATCH] arm64: implement support for static call trampolines Ard Biesheuvel
2020-10-19 17:05 ` Peter Zijlstra [this message]
2020-10-19 17:23 ` Ard Biesheuvel
2020-10-20 7:51 ` 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=20201019170550.GR2611@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ardb@kernel.org \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).