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: Michael Matz <matz at suse dot de>
- To: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- Cc: Li Bin <huawei dot libin at huawei dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, richard dot earnshaw at arm dot com, andrew dot wafaa at arm dot com, szabolcs dot nagy at arm dot com, masami dot hiramatsu dot pt at hitachi dot com, geoff at infradead dot org, takahiro dot akashi at linaro dot org, guohanjun at huawei dot com, felix dot yang at huawei dot com, jiangjiji at huawei dot com
- Date: Fri, 15 Apr 2016 17:40:46 +0200 (CEST)
- 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>
Hi,
On Thu, 14 Apr 2016, Maxim Kuvyrkov wrote:
> It appears that implementing -fprolog-pad=N option in GCC will not
> enable kernel live-patching support for AArch64. The proposal for the
> option was to make GCC output a given number of NOPs at the beginning of
> each function, and then the kernel could use that NOP pad to insert
> whatever instructions it needs. The modification of kernel instruction
> stream needs to be done atomically, and, unfortunately, it seems the
> kernel can use only architecture-provided atomicity primitives -- i.e.,
> changing at most 8 bytes at a time.
Replace first nop with a breakpoint, handle rest of patching in breakpoint
handler, patch breakpoint insn last, no need to atomically patch multiple
instructions.
Ciao,
Michael.