RFC livepatch: arm64: add support for livepatch on arm64
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest0 of 3 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 3 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/3] livepatch: arm64: add support for livepatch on arm64
Quoted 11 lines · Li Bin
This patchset depends on the on-going gcc feature "-fprolog-pad=N", which will generate a pad of N nops at the beginning of each function.
Livepatch on arm64 can using the feature (that always placing one nop at the beginning of the function). And when enable/disable func patching, just modify the pad code to nop or branch. And that NOP and B instruction are both safe instructions on arm64 which called "concurrent modification and execution of instructions", that can be executed by one thread of execution as they are being modified by another thread of execution without requiring explicit synchronization.
Quoted 3 lines
And this method will improve performance significantly compared with the method based on ftrace, especially for the critical function being frequently called.
It sounds like a great feature for ftrace. If the new prologue is usable for LivePatching, it should be usable to call the ftrace handler as well. If you teach ftrace to use the new prologue, you will not need all these crazy arch-specific hacks for LivePatching. Then both ftrace and livepatch will benefit from the feature.
I suggest to read the ftrace documentation in Documentation/trace/, especially ftrace-design.txt. I have never ported ftrace to a new architecture. I guess that you need to teach scripts/recordmcount.c
to find the new location. Also you might need to updatearch/arm/kernel/ftrace.c. Also please make sure that ftrace supports DYNAMIC_FTRACE_WITH_REGS on Arm.
It is harder but the right way to go. Your current patch set looks like a hack.
Best Regards,
Petr