This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [AArch64] support -mfentry feature for arm64
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Apr 2016 15:32:33 +0100
- Subject: Re: [PATCH] [AArch64] support -mfentry feature for arm64
- Authentication-results: sourceware.org; auth=none
- References: <1457943260-30894-1-git-send-email-huawei dot libin at huawei dot com> <B6E2AECD-096C-489F-A217-8140E781E722 at linaro dot org> <alpine dot LSU dot 2 dot 20 dot 1604151739210 dot 20277 at wotan dot suse dot de> <alpine dot LNX dot 2 dot 20 dot 1604152026570 dot 26109 at monopod dot intra dot ispras dot ru>
On 04/15/2016 06:29 PM, Alexander Monakov wrote:
> Alternatively: replace first nop with a short forward branch that
> jumps over the rest of the pad, patch rest of the pad, patch the
> initial forward branch.
That may not be safe. Consider an implementation which looks ahead in
the instruction stream and decodes the instructions speculatively. I
suppse you could begin the block of instructions after the branch with
an ISB. On balance, the trap sounds like the best plan. We do this
in Java all the time: every method begins with a NOP, and we patch it
either to a trap or to a call to the replacement code.
Andrew.