[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7080d2a9-6ec2-94e9-3577-e5f7233ad3ab@linux.microsoft.com>
Date: Thu, 17 Jun 2021 13:32:08 -0500
From: "Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>
To: "nobuta.keiya@...itsu.com" <nobuta.keiya@...itsu.com>,
Suraj Jitindar Singh <surajjs@...zon.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"will@...nel.org" <will@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"broonie@...nel.org" <broonie@...nel.org>,
"duwe@....de" <duwe@....de>,
"sjitindarsingh@...il.com" <sjitindarsingh@...il.com>,
"benh@...nel.crashing.org" <benh@...nel.crashing.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RFC PATCH 1/1] arm64: implement live patching
On 6/17/21 4:29 AM, nobuta.keiya@...itsu.com wrote:
>
>> It's my understanding that the two pieces of work required to enable live
>> patching on arm are in flight upstream;
>> - Reliable stack traces as implemented by Madhavan T. Venkataraman [1]
>> - Objtool as implemented by Julien Thierry [2]
>>
>> This is the remaining part required to enable live patching on arm.
>> Based on work by Torsten Duwe [3]
>>
>> Allocate a task flag used to represent the patch pending state for the
>> task. Also implement generic functions klp_arch_set_pc() &
>> klp_get_ftrace_location().
>>
>> In klp_arch_set_pc() it is sufficient to set regs->pc as in
>> ftrace_common_return() the return address is loaded from the stack.
>>
>> ldr x9, [sp, #S_PC]
>> <snip>
>> ret x9
>>
>> In klp_get_ftrace_location() it is necessary to advance the address by
>> AARCH64_INSN_SIZE (4) to point to the BL in the callsite as 2 nops were
>> placed at the start of the function, one to be patched to save the LR and
>> another to be patched to branch to the ftrace call, and
>> klp_get_ftrace_location() is expected to return the address of the BL. It
>> may also be necessary to advance the address by another AARCH64_INSN_SIZE
>> if CONFIG_ARM64_BTI_KERNEL is enabled due to the instruction placed at the
>> branch target to satisfy BTI,
>>
>> Signed-off-by: Suraj Jitindar Singh <surajjs@...zon.com>
>>
>> [1] https://lkml.org/lkml/2021/5/26/1212
>> [2] https://lkml.org/lkml/2021/3/3/1135
>> [3] https://lkml.org/lkml/2018/10/26/536
>> ---
>
> AFAIU Madhavan's patch series linked in the above [1] is currently awaiting
> review by Mark Rutland. It seems that not only this patch series but also the
> implementation of arch_stack_walk_reliable() at the below link is required
> to enable livepatch.
>
Yes. I have a patch ready for that. But I can submit that only after the previous
series has been accepted.
Thanks
Madhavan
Powered by blists - more mailing lists