This is the mail archive of the
mailing list for the GCC project.
[PATCH] [AArch64] support -mfentry feature for arm64
- From: Li Bin <huawei dot libin at huawei dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <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>, <huawei dot libin at huawei dot com>
- Date: Mon, 14 Mar 2016 16:14:19 +0800
- Subject: [PATCH] [AArch64] support -mfentry feature for arm64
- Authentication-results: sourceware.org; auth=none
As ARM64 is entering enterprise world, machines can not be stopped for
some critical enterprise production environment, that is, live patch as
one of the RAS features is increasing more important for ARM64 arch now.
Now, the mainstream live patch implementation which has been merged in
Linux kernel (x86/s390) is based on the 'ftrace with regs' feature, and
this feature needs the help of gcc.
This patch proposes a generic solution for arm64 gcc which called mfentry,
following the example of x86, mips, s390, etc. and on these archs, this
feature has been used to implement the ftrace feature 'ftrace with regs'
to support live patch.
By now, there is an another solution from linaro , which proposes to
implement a new option -fprolog-pad=N that generate a pad of N nops at the
beginning of each function. This solution is a arch-independent way for gcc,
but there may be some limitations which have not been recognized for Linux
kernel to adapt to this solution besides the discussion on , typically
for powerpc archs. Furthermore I think there are no good reasons to promote
the other archs (such as x86) which have implemented the feature 'ftrace with regs'
to replace the current method with the new option, which may bring heavily
target-dependent code adaption, as a result it becomes a arm64 dedicated
solution, leaving kernel with two different forms of implementation.
[AArch64] support -mfentry feature for arm64
gcc/config/aarch64/aarch64.c | 23 +++++++++++++++++++++++
gcc/config/aarch64/aarch64.h | 13 ++++++++-----
gcc/config/aarch64/aarch64.opt | 4 ++++
3 files changed, 35 insertions(+), 5 deletions(-)