Messages in this thread | | | Date | Tue, 11 Jun 2019 12:11:12 -0400 | From | Steven Rostedt <> | Subject | Re: [PATCH 08/15] x86/alternatives: Teach text_poke_bp() to emulate instructions |
| |
On Tue, 11 Jun 2019 08:54:23 -0700 Andy Lutomirski <luto@amacapital.net> wrote:
> How does that help? If RIP == x+2 and you want to put a 5-byte jump > at address x, no amount of 0xcc is going to change the fact that RIP > is in the middle of the jump. > > Live patching can handle this by detecting this condition on each > CPU, but performance won’t be great. Maybe some synchronize_sched > trickery could help.
We have synchronize_rcu_tasks() which return after all tasks have either entered user space or did a voluntary schedule (was not preempted). Or have not run (still in a sleeping state).
That way we guarantee that all tasks are no longer on any trampoline or code paths that do not call schedule. I use this to free dynamically allocated trampolines used by ftrace. And kprobes uses this too for its own trampolines.
-- Steve
| |