This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Kernel livepatching support in GCC
- From: Jim Wilson <jim dot wilson at linaro dot org>
- To: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Cc: Li Bin <huawei dot libin at huawei dot com>, Andi Kleen <ak at linux dot intel dot com>, Takahiro Akashi <takahiro dot akashi at linaro dot org>
- Date: Thu, 28 May 2015 15:41:07 -0700
- Subject: Re: [RFC] Kernel livepatching support in GCC
- Authentication-results: sourceware.org; auth=none
- References: <844CBBAF-DA0E-4164-9E35-34075A26F665 at linaro dot org>
On 05/28/2015 01:39 AM, Maxim Kuvyrkov wrote:
> Akashi-san and I have been discussing required GCC changes to make kernel's livepatching work for AArch64 and other architectures. At the moment livepatching is supported for x86[_64] using the following options: "-pg -mfentry -mrecord-mcount -mnop-mcount" which is geek-speak for "please add several NOPs at the very beginning of each function, and make a section with addresses of all those NOP pads".
FYI, there is also the darwin/rs6000 -mfix-and-continue support, which
adds 5 nops to the prologue. This was a part of a gdb feature, to allow
one to load a fixed function into a binary inside the debugger, and then
continue executing with the fixed code. It sounds like your kernel
feature is doing something very similar. If you are making this a
generic feature, then maybe the darwin/rs6000 -mfix-and-continue support
can be merged with it somehow.